From d2ebbf793c91258fc55a27ad6a07ca18c768c7f5 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Fri, 29 Dec 2017 13:23:51 -0500 Subject: [PATCH] darwin: Untangle clock_* API tests from atomics tests Signed-off-by: Chris Dickens --- libusb/os/darwin_usb.c | 7 ++++++- libusb/version_nano.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) 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