]> git.sesse.net Git - vlc/commitdiff
Fix monotonic clock POSIX option detection
authorRémi Denis-Courmont <rem@videolan.org>
Wed, 24 May 2006 20:39:21 +0000 (20:39 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Wed, 24 May 2006 20:39:21 +0000 (20:39 +0000)
src/misc/mtime.c

index ada992a2b57ec4391822fcb9220bd81e26147686..cc3911548ea714d22f0c2662b475e9fe977fd522 100644 (file)
@@ -190,7 +190,7 @@ mtime_t mdate( void )
 #elif defined (HAVE_CLOCK_GETTIME)
     struct timespec ts;
 
-# ifdef _POSIX_MONOTONIC_CLOCK
+# if (_POSIX_MONOTONIC_CLOCK >= 0)
     /* Try to use POSIX monotonic clock if available */
     if( clock_gettime( CLOCK_MONOTONIC, &ts ) )
 # endif
@@ -257,7 +257,7 @@ void mwait( mtime_t date )
     ts.tv_sec = d.quot;
     ts.tv_nsec = d.rem * 1000;
 
-# ifdef _POSIX_MONOTONIC_CLOCK
+# if (_POSIX_MONOTONIC_CLOCK >= 0)
     if( clock_nanosleep( CLOCK_MONOTONIC, 0 /*TIMER_ABSTIME*/, &ts, NULL ) )
 # endif
         (void)clock_nanosleep( CLOCK_REALTIME, 0, &ts, NULL );