Commit f04cf0cd authored by Michael Lee's avatar Michael Lee Committed by Facebook Github Bot 9

Time.h portability for iOS 10.

Summary: The iOS sdk adds `clock_gettime` support.

Reviewed By: clementgenzmer

Differential Revision: D3427621

fbshipit-source-id: fcd3022c5ea05ceb8e289fbeb1ae845155d2dea9
parent 0806af8f
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include <folly/portability/Time.h> #include <folly/portability/Time.h>
#if !FOLLY_HAVE_CLOCK_GETTIME #if !FOLLY_HAVE_CLOCK_GETTIME
#if __MACH__ #if __MACH__ && !defined(__CLOCK_AVAILABILITY)
#include <errno.h> #include <errno.h>
#include <mach/mach_time.h> #include <mach/mach_time.h>
......
...@@ -21,9 +21,11 @@ ...@@ -21,9 +21,11 @@
#include <folly/portability/Config.h> #include <folly/portability/Config.h>
// These aren't generic implementations, so we can only declare them on // These aren't generic implementations, so we can only declare them
// platforms we support. // on platforms we support. Apple started defining clock_gettime in
#if !FOLLY_HAVE_CLOCK_GETTIME && (defined(__MACH__) || defined(_WIN32)) // iOS 10 / OSX 12 and is gated via __CLOCK_AVAILABILITY.
#if !FOLLY_HAVE_CLOCK_GETTIME && \
(defined(_WIN32) || (defined(__MACH__) && !defined(__CLOCK_AVAILABILITY)))
#define CLOCK_REALTIME 0 #define CLOCK_REALTIME 0
// The Windows implementation supports a few other // The Windows implementation supports a few other
// clock types as well. // clock types as well.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment