On 6/4/07, Giel van Schijndel <[EMAIL PROTECTED]> wrote: > Ari Johnson schreef: > > On 6/4/07, Giel van Schijndel <[EMAIL PROTECTED]> wrote: > > > >> Ari Johnson schreef: > >> > >>> Reverted changes from r1417 and r1421 that used 'bool' instead of > >>> 'BOOL' and thereby prevented the code from building > >>> > >> Does this really _not_ compile ? Because it _should_ compile. (Even with > >> a non-C99 compatible compiler). > >> > >> Just look at lib/framework/types.h: > >> > >>> // If we are C99 compatible, the "bool" macro will be defined in > >>> <stdbool.h> (as _Bool) > >>> #if defined(WZ_C99) > >>> # include <stdbool.h> > >>> #else > >>> // Pretend we are C99 compatible (well, for the bool type then) > >>> # ifndef bool > >>> # define bool BOOL > >>> # endif > >>> # ifndef true > >>> # define true (1) > >>> # endif > >>> # ifndef false > >>> # define false (0) > >>> # endif > >>> # ifndef __bool_true_false_are_defined > >>> # define __bool_true_false_are_defined (1) > >>> # endif > >>> #endif /* WZ_C99 */ > >>> > >> So if that code doesn't compile when using "bool", please fix the above > >> code in types.h instead of reverting back to "BOOL". > >> > >> The only scenario I can think of is that the compiler you use claims to > >> be C99 compatible, but doesn't provide macros: "bool", "true", "false" > >> and "__bool_true_false_are_defined" (which it _should_ provide if it > >> claims C99 compatibility). Although I might look over something. > >> > > Every other place in the code uses BOOL. Only these two lines used > > bool. Lines immediately above and below each of them used BOOL. > > > > C99 also provides <stdbool.h>, which on my system defines 'bool'. > > Have you read the standard? See > > http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf p. 253, > > which says that stdbool.h defines the bool type. > > > Actually, yes I have read the C99 standard just to create that piece of > code ^^ in types.h. If you look carefully then you see that all the > #ifndef statements are only executed when I the compiler doesn't claim > to support C99. So that piece of code _simulates_ C99 capability for > non-C99 compilers. >
I have gcc 4.0.1, which is C99-compatible the last I checked. I have narrowed down the problem to __STDC_VERSION__ not being defined because I need to specify --std=c99. I will change that in the Xcode project. That said, why do we have a mix of BOOL and (only two instances of) bool? Why not change all the BOOLs to bool? _______________________________________________ Warzone-dev mailing list Warzone-dev@gna.org https://mail.gna.org/listinfo/warzone-dev