This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch]: Merge from gnustep for obj-c. Remove warnings for target w64.


>        * 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]