1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

[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.
This commit is contained in:
hniksic 2005-04-15 12:29:19 -07:00
parent c65d4ff828
commit 32a716a20e
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2005-04-15 Hrvoje Niksic <hniksic@xemacs.org>
* 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 <hniksic@xemacs.org> 2005-04-15 Hrvoje Niksic <hniksic@xemacs.org>
* ptimer.c: Check that _POSIX_TIMERS is defined as well as > 0. * ptimer.c: Check that _POSIX_TIMERS is defined as well as > 0.

View File

@ -92,7 +92,7 @@ extern int errno;
#if defined(WINDOWS) || defined(__CYGWIN__) #if defined(WINDOWS) || defined(__CYGWIN__)
# define PTIMER_WINDOWS /* use Windows timers */ # define PTIMER_WINDOWS /* use Windows timers */
#else #else
# if defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0 # if _POSIX_TIMERS - 0 > 0
# define PTIMER_POSIX /* use POSIX timers (clock_gettime) */ # define PTIMER_POSIX /* use POSIX timers (clock_gettime) */
# else # else
# ifdef HAVE_GETTIMEOFDAY # ifdef HAVE_GETTIMEOFDAY
@ -139,7 +139,7 @@ posix_init (void)
int id; int id;
int sysconf_name; int sysconf_name;
} clocks[] = { } clocks[] = {
#if defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0 #if _POSIX_MONOTONIC_CLOCK - 0 >= 0
{ CLOCK_MONOTONIC, _SC_MONOTONIC_CLOCK }, { CLOCK_MONOTONIC, _SC_MONOTONIC_CLOCK },
#endif #endif
#ifdef CLOCK_HIGHRES #ifdef CLOCK_HIGHRES