X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f Date: 08 Jan 2004 11:34:05 +0200 Message-Id: From: Eli Zaretskii To: djgpp-workers AT delorie DOT com In-reply-to: <3FFCF1F4.B86AC9DA@yahoo.com> (message from CBFalconer on Thu, 08 Jan 2004 01:00:20 -0500) Subject: Re: stdbool.h and complex.h References: <3FFCF1F4 DOT B86AC9DA AT yahoo DOT com> Note-from-DJ: This may be spam Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Date: Thu, 08 Jan 2004 01:00:20 -0500 > From: CBFalconer > > > > #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?