]> git.sesse.net Git - vlc/commitdiff
Work-around for overaging POSIX systems
authorRémi Denis-Courmont <rem@videolan.org>
Wed, 19 Dec 2007 20:46:45 +0000 (20:46 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Wed, 19 Dec 2007 20:46:45 +0000 (20:46 +0000)
src/misc/mtime.c
src/misc/threads.c

index 955e3d3e243c1cbbc545dfb1ee94d0d524d3fba4..91c7187f91eb842e661ae06ef396cac8b74000fa 100644 (file)
@@ -67,7 +67,11 @@ struct timespec
 int nanosleep(struct timespec *, struct timespec *);
 #endif
 
-#if (!defined (_POSIX_CLOCK_SELECTION)) || (_POSIX_CLOCK_SELECTION < 0)
+#if !defined (_POSIX_CLOCK_SELECTION)
+#  define _POSIX_CLOCK_SELECTION (-1)
+#endif
+
+# if (_POSIX_CLOCK_SELECTION < 0)
 /*
  * We cannot use the monotonic clock is clock selection is not available,
  * as it would screw vlc_cond_timedwait() completely. Instead, we have to
index affdc2276fb39df6fb6b0d119f025f6f6f3c2740..f210b287dae2ed706efa9a667fdd417ab124456c 100644 (file)
@@ -484,7 +484,11 @@ int __vlc_cond_init( vlc_object_t *p_this, vlc_cond_t *p_condvar )
     if (ret)
         return ret;
 
-# if defined (_POSIX_CLOCK_SELECTION) && (_POSIX_CLOCK_SELECTION >= 0)
+# if !defined (_POSIX_CLOCK_SELECTION)
+   /* Fairly outdated POSIX support (that was defined in 2001) */
+#  define _POSIX_CLOCK_SELECTION (-1)
+# endif
+# if (_POSIX_CLOCK_SELECTION >= 0)
     /* NOTE: This must be the same clock as the one in mtime.c */
     pthread_condattr_setclock (&attr, CLOCK_MONOTONIC);
 # endif