realtime: don't use custom functions on Sierra
authorAlexis Laferrière <alexis.laf@xymus.net>
Thu, 2 Feb 2017 16:23:53 +0000 (11:23 -0500)
committerAlexis Laferrière <alexis.laf@xymus.net>
Thu, 2 Feb 2017 17:49:05 +0000 (12:49 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/realtime.nit

index 243b5d8..eac21df 100644 (file)
@@ -23,7 +23,7 @@ in "C header" `{
 
 in "C" `{
 
-#ifdef __MACH__
+#if defined(__MACH__) && !defined(CLOCK_REALTIME)
 /* OS X does not have clock_gettime, mascarade it and use clock_get_time
  * cf http://stackoverflow.com/questions/11680461/monotonic-clock-on-osx
 */
@@ -148,7 +148,7 @@ class Clock
        # Smallest time frame reported by clock
        fun resolution: Timespec `{
                struct timespec* tv = malloc( sizeof(struct timespec) );
-#ifdef __MACH__
+#if defined(__MACH__) && !defined(CLOCK_REALTIME)
                clock_serv_t cclock;
                int nsecs;
                mach_msg_type_number_t count;