summaryrefslogtreecommitdiff
path: root/Xcode
diff options
context:
space:
mode:
authorChris Dickens <christopher.a.dickens@gmail.com>2020-01-26 22:43:28 -0800
committerChris Dickens <christopher.a.dickens@gmail.com>2020-03-15 23:31:14 -0700
commit26b16eb65a61b37b64ce8962b5b7d927c3c54a7d (patch)
tree24091a43dc1cec22b078c9b2de886ddcff7ae3c8 /Xcode
parentf5c9f6794dc8afd8789e383bbcbf0eab087c55f2 (diff)
downloadlibusb-26b16eb65a61b37b64ce8962b5b7d927c3c54a7d.tar.gz
core: Kill usbi_backend.clock_gettime() function
Out of all the backends supported by libusb, only two need to provide an implementation of the clock_gettime() function. Windows completely lacks such a function and versions of Mac OS prior to 10.12 do not provide it. In all other cases the backend simply ends up calling the C library's clock_gettime() function. Let's optimize for the common case and check for the availability of clock_gettime() during configure. If available, we will just call it directly from any part of the library that needs it. If not available, the backend is required to provide an implementation of usbi_clock_gettime() that matches the current requirements. Closes #685 Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Diffstat (limited to 'Xcode')
-rw-r--r--Xcode/config.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/Xcode/config.h b/Xcode/config.h
index 694fd9a..1815715 100644
--- a/Xcode/config.h
+++ b/Xcode/config.h
@@ -1,5 +1,12 @@
/* config.h. Manually generated for Xcode. */
+/* On 10.12 and later, use newly available clock_*() functions */
+#include <AvailabilityMacros.h>
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
+/* Define to 1 if you have the `clock_gettime' function. */
+#define HAVE_CLOCK_GETTIME 1
+#endif
+
/* Default visibility */
#define DEFAULT_VISIBILITY /**/