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