From 32a716a20e86f332a1a03202b80dde0fefbd7068 Mon Sep 17 00:00:00 2001 From: hniksic Date: Fri, 15 Apr 2005 12:29:19 -0700 Subject: [PATCH] [svn] Use _POSIX_TIMERS - 0 > 0, which handles the case when POSIX_TIMERS is _defined but empty, as well as the case when it is undefined. Do the same with the check for _POSIX_MONOTONIC_CLOCK. Suggested by Larry Jones. --- src/ChangeLog | 7 +++++++ src/ptimer.c | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index dec3d4ca..57644018 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2005-04-15 Hrvoje Niksic + + * ptimer.c: Use _POSIX_TIMERS - 0 > 0, which handles the case when + _POSIX_TIMERS is defined but empty, as well as the case when it is + undefined. Do the same with the check for _POSIX_MONOTONIC_CLOCK. + Suggested by Larry Jones. + 2005-04-15 Hrvoje Niksic * ptimer.c: Check that _POSIX_TIMERS is defined as well as > 0. diff --git a/src/ptimer.c b/src/ptimer.c index 3a09ceba..3eeb78c6 100644 --- a/src/ptimer.c +++ b/src/ptimer.c @@ -92,7 +92,7 @@ extern int errno; #if defined(WINDOWS) || defined(__CYGWIN__) # define PTIMER_WINDOWS /* use Windows timers */ #else -# if defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0 +# if _POSIX_TIMERS - 0 > 0 # define PTIMER_POSIX /* use POSIX timers (clock_gettime) */ # else # ifdef HAVE_GETTIMEOFDAY @@ -139,7 +139,7 @@ posix_init (void) int id; int sysconf_name; } clocks[] = { -#if defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0 +#if _POSIX_MONOTONIC_CLOCK - 0 >= 0 { CLOCK_MONOTONIC, _SC_MONOTONIC_CLOCK }, #endif #ifdef CLOCK_HIGHRES