fix crash when copy'ing latent plugins
[ardour.git] / libs / ardour / globals.cc
index cdfd4e036dadc42d7c6eb12e158c64945879ce55..974247aef57cb08d26daebf280485cee9bc1da8e 100644 (file)
 #include "audiographer/routines.h"
 
 #if defined (__APPLE__)
-       #include <Carbon/Carbon.h> // For Gestalt
+#include <CoreFoundation/CoreFoundation.h>
 #endif
 
 #include "pbd/i18n.h"
@@ -206,12 +206,8 @@ setup_hardware_optimization (bool try_optimization)
                }
 
 #elif defined (__APPLE__) && defined (BUILD_VECLIB_OPTIMIZATIONS)
-               SInt32 sysVersion = 0;
 
-               if (noErr != Gestalt(gestaltSystemVersion, &sysVersion))
-                       sysVersion = 0;
-
-               if (sysVersion >= 0x00001040) { // Tiger at least
+               if (floor (kCFCoreFoundationVersionNumber) > kCFCoreFoundationVersionNumber10_4) { /* at least Tiger */
                        compute_peak           = veclib_compute_peak;
                        find_peaks             = veclib_find_peaks;
                        apply_gain_to_buffer   = veclib_apply_gain_to_buffer;