Re: Help porting from codewarrior?
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