X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f Message-ID: <3FFCF1F4.B86AC9DA@yahoo.com> Date: Thu, 08 Jan 2004 01:00:20 -0500 From: CBFalconer Organization: Ched Research X-Mailer: Mozilla 4.75 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: djgpp-workers AT delorie DOT com Subject: Re: stdbool.h and complex.h References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Esa A E Peuha wrote: > > I have written the headers stdbool.h and complex.h that C99 requires. > stdbool.h doesn't define any functions and is independent of any > choice in compiler (in other words, whatever way gcc chooses to > support Boolean type, it can't affect the contents of stdbool.h), > so it could be checked in at any time: > > #ifndef __dj_stdbool__h_ > #define __dj_stdbool__h_ > > #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. I am not convinced either way myself. Just raising the question. My inclination would be to omit the ANSI portion of it. -- Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT worldnet DOT att DOT net) Available for consulting/temporary embedded and systems. USE worldnet address!