diff --git a/libusb/os/darwin_usb.c b/libusb/os/darwin_usb.c index b01d349..8beeb12 100644 --- a/libusb/os/darwin_usb.c +++ b/libusb/os/darwin_usb.c @@ -45,7 +45,6 @@ /* Apple deprecated the darwin atomics in 10.12 in favor of C11 atomics */ #include #define libusb_darwin_atomic_fetch_add(x, y) atomic_fetch_add(x, y) -#define OSX_USE_CLOCK_GETTIME 1 _Atomic int32_t initCount = ATOMIC_VAR_INIT(0); #else @@ -57,6 +56,12 @@ _Atomic int32_t initCount = ATOMIC_VAR_INIT(0); static volatile int32_t initCount = 0; +#endif + +/* On 10.12 and later, use newly available clock_*() functions */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101200 +#define OSX_USE_CLOCK_GETTIME 1 +#else #define OSX_USE_CLOCK_GETTIME 0 #endif diff --git a/libusb/version_nano.h b/libusb/version_nano.h index 92e7b53..84f7c07 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 11281 +#define LIBUSB_NANO 11282