macOS Sierra provides clock_gettime().
Instead of testing for the Mach kernel to re-implement clock_gettime(),
let first check that clock_gettime() is not already declared. Older OSX
versions will have the Mach-only fallback.
@fix
#include "eina_suite.h"
-#ifdef __MACH__
-# include <mach/clock.h>
-# include <mach/mach.h>
+#ifndef HAVE_CLOCK_GETTIME
-#define CLOCK_REALTIME 0
+# ifdef __MACH__
+# include <mach/clock.h>
+# include <mach/mach.h>
+
+# define CLOCK_REALTIME 0
int
clock_gettime(int mode, struct timespec* ts)
return 0;
}
-#endif
+# else /* ! __MACH__ */
+# error No support for clock_gettime()
+# endif /* __MACH__ *//
+
+#endif /* ! HAVE_CLOCK_GETTIME */
static Eina_Spinlock spin;
static Eina_Thread thread;