bugGNUstep - Bugs: bug #31237, Cocoa.h redefinition problems

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #31237: Cocoa.h redefinition problems

Submitted by:  Riccardo Mottola <rmottola>
Submitted on:  Sun 03 Oct 2010 09:41:53 PM UTC  
 
Category: Base/FoundationSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: Fred Kiefer <FredKiefer>
Open/Closed: Closed

Sat 05 Mar 2011 04:42:54 PM UTC, comment #3:

Closing this since Fred fixed it months ago and there has been no feedback.

Richard Frith-Macdonald <CaS>
Project Member
Wed 13 Oct 2010 08:26:32 PM UTC, comment #2:

I just commited a patch that combines your suggestion with the old code. Could you please give this a try?

Fred Kiefer <FredKiefer>
Project MemberIn charge of this item.
Sun 03 Oct 2010 10:37:10 PM UTC, comment #1:

in Cocoa.h, instead of

40 #if (!defined(__cplusplus) && !defined(__USE_ISOC99))
41 typedef BOOL bool;
42 #define false NO
43 #define true YES
44 #endif

it should probably be

#if (!defined(__cplusplus) && !defined(__bool_true_false_are_defined))

(According to this: http://www.opengroup.org/onlinepubs/9699919799/basedefs/stdbool.h.html )

Eric Wasylishen <ericw>
Project Member
Sun 03 Oct 2010 09:41:53 PM UTC, original submission:

When Cocoa.h is included on OpenBSD with gcc 2.95, the following error happens:

Compiling file VEAppController.m ...
In file included from /usr/GNUstep/Local/Library/Headers/WebKit/WebPlugin.h:25,
from /usr/GNUstep/Local/Library/Headers/WebKit/WebKit.h:35,
from VEDocument.h:27,
from VEAppController.m:27:
/usr/GNUstep/System/Library/Headers/Cocoa/Cocoa.h:42: warning: `false' redefined
/usr/include/stdbool.h:26: warning: this is the location of the previous definition
/usr/GNUstep/System/Library/Headers/Cocoa/Cocoa.h:43: warning: `true' redefined
/usr/include/stdbool.h:27: warning: this is the location of the previous definition
In file included from /usr/GNUstep/Local/Library/Headers/WebKit/WebPlugin.h:25,
from /usr/GNUstep/Local/Library/Headers/WebKit/WebKit.h:35,
from VEDocument.h:27,
from VEAppController.m:27:
/usr/GNUstep/System/Library/Headers/Cocoa/Cocoa.h:41: conflicting types for `_Bool'
/usr/include/stdbool.h:23: previous declaration of `_Bool'

A similar error happens for other files that include it. I cannot reproduce this with FreeBSD/gcc 4.2

Furthermore, if Foundation and AppKit are included instead of Cocoa, the problem goes away.

Riccardo Mottola <rmottola>
Project Member

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by CaS (Posted a comment)
  • -unavailable- added by FredKiefer (Posted a comment)
  • -unavailable- added by ericw (Posted a comment)
  • -unavailable- added by rmottola (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 05 Mar 2011 04:42:54 PM UTCCaSStatusReady For Test=>Fixed
      Open/ClosedIn Test=>Closed
    Wed 13 Oct 2010 08:26:32 PM UTCFredKieferStatusNone=>Ready For Test
      Assigned toNone=>FredKiefer
      Open/ClosedOpen=>In Test

    Back to the top


    Powered by Savane 3.1-cleanup1