diff options
author | Oscar Lim <olim@ucla.edu> | 2016-09-27 22:49:47 -0700 |
---|---|---|
committer | Oscar Lim <olim@ucla.edu> | 2016-09-28 22:57:43 -0700 |
commit | 04b8076512ef71fac5a26cbe85f8d820bd3ccfea (patch) | |
tree | 00dcde413da94404dd6bc0da902b9aa4f8d9250c /src | |
parent | 5e172430e57c1349485a151fa8000b12071a4671 (diff) | |
download | luasystem-04b8076512ef71fac5a26cbe85f8d820bd3ccfea.tar.gz luasystem-04b8076512ef71fac5a26cbe85f8d820bd3ccfea.tar.bz2 luasystem-04b8076512ef71fac5a26cbe85f8d820bd3ccfea.zip |
Fix `clock_gettime` for Mac OS X 10.12
Diffstat (limited to 'src')
-rw-r--r-- | src/time.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -10,8 +10,16 @@ | |||
10 | #include <sys/time.h> | 10 | #include <sys/time.h> |
11 | #endif | 11 | #endif |
12 | 12 | ||
13 | #ifndef HAVE_CLOCK_GETTIME | ||
14 | #ifdef __APPLE__ | 13 | #ifdef __APPLE__ |
14 | #include <AvailabilityMacros.h> | ||
15 | |||
16 | #ifndef MAC_OS_X_VERSION_10_12 | ||
17 | #define MAC_OS_X_VERSION_10_12 101200 | ||
18 | #endif | ||
19 | |||
20 | #define HAVE_CLOCK_GETTIME (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12 || defined(CLOCK_MONOTONIC)) | ||
21 | |||
22 | #if !(HAVE_CLOCK_GETTIME) | ||
15 | #include "time_osx.h" | 23 | #include "time_osx.h" |
16 | #endif | 24 | #endif |
17 | #endif | 25 | #endif |