> I suppose we should then use:
>
> #ifdef _POSIX_TIMERS
> # if _POSIX_TIMERS > 0
Doesn't help. It's defined, but null.
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 a symbolic constant is defined with the value -1, the option is
not supported. Headers, data types, and function interfaces
required only for the option need not be supplied. An application
that attempts to use anything associated only with the option is
considered to be requiring an extension.
If a symbolic constant is defined with a value greater than zero,
the option shall always be supported when the application is
executed. All headers, data types, and functions shall be present
and shall operate as specified.
If a symbolic constant is defined with the value zero, all
headers, data types, and functions shall be present. The
application can check at runtime to see whether the option is
supported by calling fpathconf(), pathconf(), or sysconf() with
the indicated name parameter.
Pending a good counter argument, the best way out may be:
# if defined(_POSIX_TIMERS) && (_POSIX_TIMERS - 0 >= 0)
Perhaps with a comment describing the (unknown) danger. (Then wait for
the next complaint.) Everything's complicated.
SMS.