Mail Archives: djgpp-workers/2004/01/08/04:32:38
> Date: Thu, 08 Jan 2004 01:00:20 -0500
> From: CBFalconer <cbfalconer AT yahoo DOT com>
> >
> > #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
> > || !defined(__STRICT_ANSI__)
> >
> > #define bool _Bool
> > #define true 1
> > #define false 0
> > #define __bool_true_false_are_defined 1
> >
> > #endif /* (__STDC_VERSION__ >= 199901L) || !__STRICT_ANSI__ */
> >
> > #endif /* !__dj_stdbool__h_ */
>
> I question whether it is necessary to have the __STDC_VERSION etc.
> guard, or even desirable. I see no reason why a c90 user should
> not provide a stdbool.h system file and expect it to be used. As
> you point out, those contents are pretty universal, although a C90
> version would not be able to use _Bool. And a C99 user may well
> want to use bool etc. without insisting on strict Ansi.
But that's exactly what these guards do: if you do NOT ask for strict
ANSI, you DO have `bool' etc., even under C89. If you DO ask for
ANSI C, then they are available only under C9x, because strict-ANSI
programs that are compliant to C89 should not have their namespace
polluted by `bool'.
Or did I miss something?
- Raw text -