diff options
-rw-r--r-- | runtime/base/time_utils.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/base/time_utils.h b/runtime/base/time_utils.h index 55d2764576..383b52fb33 100644 --- a/runtime/base/time_utils.h +++ b/runtime/base/time_utils.h @@ -73,9 +73,11 @@ static constexpr inline uint64_t MsToNs(uint64_t ms) { } #if defined(__APPLE__) -// No clocks to specify on OS/X, fake value to pass to routines that require a clock. +#ifndef CLOCK_REALTIME +// No clocks to specify on OS/X < 10.12, fake value to pass to routines that require a clock. #define CLOCK_REALTIME 0xebadf00d #endif +#endif // Sleep for the given number of nanoseconds, a bad way to handle contention. void NanoSleep(uint64_t ns); |