From 04b8076512ef71fac5a26cbe85f8d820bd3ccfea Mon Sep 17 00:00:00 2001 From: Oscar Lim Date: Tue, 27 Sep 2016 22:49:47 -0700 Subject: Fix `clock_gettime` for Mac OS X 10.12 --- src/time.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/time.c b/src/time.c index 2c58950..8c6a4f2 100644 --- a/src/time.c +++ b/src/time.c @@ -10,8 +10,16 @@ #include #endif -#ifndef HAVE_CLOCK_GETTIME #ifdef __APPLE__ +#include + +#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 -- cgit v1.2.3-55-g6feb