Subject: Re: definition of TRUE and FALSE in system headers
To: None <zeurkous@nichten.info>
From: Marco Trillo <marcotrillo@gmail.com>
List: tech-userlevel
Date: 07/23/2007 16:00:49
Hi,

On 7/23/07, De Zeurkous <zeurkous@nichten.info> wrote:
> Haai,
>
> On Mon, July 23, 2007 11:41, Krister Walfridsson wrote:
> > I have seen some problems with software failing to build on NetBSD
> > 4.0_BETA2 because NetBSD now defines/redefines TRUE and FALSE when
> > you include e.g. sys/ioctl.h (the definition/redefinition
> >    #undef TRUE
> >    #define TRUE    1
> >    #undef FALSE
> >    #define FALSE   0
> > is in prop/prop_object.h that is included (via sys/dkio.h) from
> > sys/ioctl.h)
>
> Move 'em to stdbool.h -- that's where they belong.

<stdbool.h> defines "true" and "false" in lowercase (and "bool" to map
to the "_Bool" type). This is part of the C99 standard. It also
defines the "__bool_true_false_are_defined" symbol.


     -Marco