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.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 @@ #include <sys/time.h> #endif -#ifndef HAVE_CLOCK_GETTIME #ifdef __APPLE__ +#include <AvailabilityMacros.h> + +#ifndef MAC_OS_X_VERSION_10_12 +#define MAC_OS_X_VERSION_10_12 101200 +#endif + +#define HAVE_CLOCK_GETTIME (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12 || defined(CLOCK_MONOTONIC)) + +#if !(HAVE_CLOCK_GETTIME) #include "time_osx.h" #endif #endif |