[EMAIL PROTECTED] (Steven M. Schweda) writes:

>    Mr, Jones is probably close to the right answer with:
>
>> #if _POSIX_TIMERS - 0 > 0
>
> I was looking for a way to make null look like positive, but a
> little more reading
> ("http://www.opengroup.org/onlinepubs/009695399/basedefs/unistd.h.html";)
> suggests that zero is about as reasonable as anything:

If we supported _POSIX_TIMERS == 0, we'd need to check with sysconf
whether they are available and fall back to gettimeofday if not.  That
would complicate the code because the timer implementation could no
longer be chosen at compile-time.

Since we must support gettimeofday anyway, I opted to use
_POSIX_TIMERS only if they are always, and to just use gettimeofday
(which isn't really that bad) otherwise.

>    Pending a good counter argument, the best way out may be:
>
> # if defined(_POSIX_TIMERS) && (_POSIX_TIMERS - 0 >= 0)

Checking for >=0 without the sysconf check in the ==0 case seems
asking for trouble.

Reply via email to