testing for the definition of types

What is the proper way to test if my C++ compiler has defined ‘bool’ ‘true’
& ‘false’.

I want to write source code that will work for both QNX4 & 6 that use these.
Obviously if they aren’t defined I want to define them.

#ifdef doesn’t work

You could take the route that many ./configure scripts take - build a small
program
with the symbols defined, if the build fails you know they are not defined
(or
at least not where you think they are).

Lather, rinse, repeat.


Cheers,
Adam

QNX Software Systems Ltd.
[ amallory@qnx.com ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <pschon@baste.magibox.net>
“Bill Caroselli (Q-TPS)” <QTPS@EarthLink.net> wrote in message
news:agko3l$qu9$1@inn.qnx.com

What is the proper way to test if my C++ compiler has defined ‘bool’
‘true’
& ‘false’.

I want to write source code that will work for both QNX4 & 6 that use
these.
Obviously if they aren’t defined I want to define them.

#ifdef doesn’t work

Right now I’m checking for the definition of WATCOMC. But I find it
hard to believe that with all of the cross platform development that’s being
promoted today there isn’t an ANSI standard way to determine if the
particular compiler I’m using, whatever it may be, has built in support for
‘bool’, ‘true’, ‘false’ and add to the list ‘long long’.

The best thing about standards is that there are so many different ones to
choose from.

“Adam Mallory” <amallory@qnx.com> wrote in message
news:agmqe1$j58$1@nntp.qnx.com

You could take the route that many ./configure scripts take - build a
small
program
with the symbols defined, if the build fails you know they are not defined
(or
at least not where you think they are).

Lather, rinse, repeat.


Cheers,
Adam

QNX Software Systems Ltd.
[ > amallory@qnx.com > ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <> pschon@baste.magibox.net
“Bill Caroselli (Q-TPS)” <> QTPS@EarthLink.net> > wrote in message
news:agko3l$qu9$> 1@inn.qnx.com> …
What is the proper way to test if my C++ compiler has defined ‘bool’
‘true’
& ‘false’.

I want to write source code that will work for both QNX4 & 6 that use
these.
Obviously if they aren’t defined I want to define them.

#ifdef doesn’t work

\