• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Help porting from codewarrior?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help porting from codewarrior?


  • Subject: Re: Help porting from codewarrior?
  • From: Markus Hitter <email@hidden>
  • Date: Wed, 21 Sep 2005 22:34:18 +0200


Am 21.09.2005 um 20:20 schrieb Bob Sabiston:

error: 'Boolean' does not name a type

In earlier days, a

    #define Boolean char

would be a way conformant to the C standard.

C++ since it's birth and C since ANSI C99 has the "bool" type. In case of C, you need to

    #include <stdbool.h>

which is one of the conflicts between ANSI C and ANSI C++.

There are yet more forms: Carbon, X11 and a few others use "Boolean", possibly because their inventors didn't have a look at the then upcoming C++ standard. Objective-C has the "BOOL" type as part of it's language definition - Obj-C is at least as old as C++. (Merging language features seems to be a big no-no)


So, there's a way to get away without a specific header, there are other ways, and in the end it depends on your project. E.g. including Carbon.h just to get a boolean type doesn't make sense and doesn't work for cross-platform code anyways. On the flip side, all(?) Apple provided GUI frameworks include Carbon.h anyways and you usually get "Boolean" on the Mac for free.


(Wow, what a lengthy discussion of such a basic topic)


What do other people include in their prefix files?

Cocoa.h, of course ;-)


Markus

- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter
http://www.jump-ing.de/




_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Help porting from codewarrior?
      • From: Marshall Clow <email@hidden>
References: 
 >Help porting from codewarrior? (From: Bob Sabiston <email@hidden>)
 >Re: Help porting from codewarrior? (From: Cameron Hayne <email@hidden>)
 >Re: Help porting from codewarrior? (From: Bob Sabiston <email@hidden>)

  • Prev by Date: Re: Using AppleScript to access a Copy File Phase in an Xcode project
  • Next by Date: Re: distributed builds in makefiles
  • Previous by thread: Re: Help porting from codewarrior?
  • Next by thread: Re: Help porting from codewarrior?
  • Index(es):
    • Date
    • Thread