openbsd-ports/x11/vlc/patches/patch-src_posix_thread_c
2013-04-04 16:48:22 +00:00

26 lines
747 B
Plaintext

$OpenBSD: patch-src_posix_thread_c,v 1.1 2013/04/04 16:49:56 brad Exp $
Make use of clock_gettime() on OpenBSD. Until we have per-process
timers and can enable _POSIX_TIMERS in unistd.h.
--- src/posix/thread.c.orig Wed Apr 3 18:53:13 2013
+++ src/posix/thread.c Wed Apr 3 18:59:55 2013
@@ -73,7 +73,7 @@
# define _POSIX_MONOTONIC_CLOCK (-1)
#endif
-#if (_POSIX_TIMERS > 0)
+#if (_POSIX_TIMERS > 0) || defined(__OpenBSD__)
static unsigned vlc_clock_prec;
# if (_POSIX_MONOTONIC_CLOCK > 0) && (_POSIX_CLOCK_SELECTION > 0)
@@ -921,7 +921,7 @@ void vlc_control_cancel (int cmd, ...)
*/
mtime_t mdate (void)
{
-#if (_POSIX_TIMERS > 0)
+#if (_POSIX_TIMERS > 0) || defined(__OpenBSD__)
struct timespec ts;
vlc_clock_setup ();