# if defined(_POSIX_TIMERS) _POSIX_TIMERS 0
That's fine, if you prefer:
ptimer.c:95:46: operator '' has no right operand
This doc makes it appear that the unistd.h here does not conform:
http://www.opengroup.org/onlinepubs/009695399/basedefs/unistd.h.html
I fear that the test must
[EMAIL PROTECTED] (Steven M. Schweda) writes:
# if defined(_POSIX_TIMERS) _POSIX_TIMERS 0
That's fine, if you prefer:
ptimer.c:95:46: operator '' has no right operand
I suppose we should then use:
#ifdef _POSIX_TIMERS
# if _POSIX_TIMERS 0
... use POSIX timers ...
This doc makes
Hrvoje Niksic writes:
I suppose we should then use:
#ifdef _POSIX_TIMERS
# if _POSIX_TIMERS 0
The usual solution to this problem is:
#if _POSIX_TIMERS - 0 0
That gets the right answer regardless of whether _POSIX_TIMERS is
undefined, defined as nothing, or defined as a number.
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
[EMAIL PROTECTED] (Larry Jones) writes:
Hrvoje Niksic writes:
I suppose we should then use:
#ifdef _POSIX_TIMERS
# if _POSIX_TIMERS 0
The usual solution to this problem is:
#if _POSIX_TIMERS - 0 0
Neat trick, thanks.
That gets the right answer regardless of whether
[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;)
Hrvoje Niksic writes:
I guess the defined as nothing case was losing. BTW does the above
trick work with KR preprocessors?
Yep. (That's why it uses - 0 rather than + 0, the latter is only
valid for ANSI C.)
-Larry Jones
It's no fun to play games with a poor sport. -- Calvin
urt# gcc -v
Reading specs from /usr/local/lib/gcc/alpha-dec-osf5.1/3.4.3/specs
Configured with: /usr1/local/gnu/gcc-3.4.3/configure
Thread model: posix
gcc version 3.4.3
urt# sizer -v
Compaq Tru64 UNIX V5.1B (Rev. 2650); Thu Mar 6 19:03:28 CST 2003
[...]
gcc -I. -I. -I/opt/include