This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch]: Merge from gnustep for obj-c. Remove warnings for target w64.
- From: Kai Tietz <Kai dot Tietz at onevision dot com>
- To: "Danny Smith" <dansmister at gmail dot com>
- Cc: "GCC Patches" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 19 Nov 2008 09:19:42 +0100
- Subject: Re: [patch]: Merge from gnustep for obj-c. Remove warnings for target w64.
"Danny Smith" <dansmister@gmail.com> wrote on 19.11.2008 03:58:14:
> > * objc/objc.h (BOOL): Prevent redeclaration of BOOL, if already
> > there.
>
>
> --- gcc.orig/libobjc/objc/objc.h
> +++ gcc/libobjc/objc/objc.h
> @@ -39,8 +39,10 @@ extern "C" {
> #ifdef __vxworks
> typedef int BOOL;
> #else
> +#ifndef BOOL
> typedef unsigned char BOOL;
> #endif
> +#endif
> #define YES (BOOL)1
> #define NO (BOOL)0
>
>
> That doe not seem right. It means that if w32api's windef.h is
> included before the objc.h language header, then BOOL may be
> equivalent to WINBOOL which is an int. If if is included after then
> is in an unsigned char. Wouldn't it be better to just #iundef BOOL
> before the typedef?
>
> Danny
Well, I see in both cases a problem here. So to have the pattern
#ifdef BOOL
#undef BOOL
#endif
typedef unsigned char BOOL;
and the pattern
#ifndef BOOL
typedef unsigned char BOOL;
#endif
are equivalent IMHO. But I open-minded for this, but see no real advantage
between one of the variants.
Kai
| (\_/) This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.