darwin: Untangle clock_* API tests from atomics tests
authorSean McBride <sean@rogue-research.com>
Fri, 29 Dec 2017 18:23:51 +0000 (13:23 -0500)
committerChris Dickens <christopher.a.dickens@gmail.com>
Mon, 8 Jan 2018 18:29:45 +0000 (10:29 -0800)
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
libusb/os/darwin_usb.c
libusb/version_nano.h

index b01d349..8beeb12 100644 (file)
@@ -45,7 +45,6 @@
 /* Apple deprecated the darwin atomics in 10.12 in favor of C11 atomics */
 #include <stdatomic.h>
 #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
 
index 92e7b53..84f7c07 100644 (file)
@@ -1 +1 @@
-#define LIBUSB_NANO 11281
+#define LIBUSB_NANO 11282