Re: Weird inline/struct offset problem
Re: Weird inline/struct offset problem
- Subject: Re: Weird inline/struct offset problem
- From: "Sean McBride" <email@hidden>
- Date: Thu, 17 Aug 2006 13:05:17 -0400
- Organization: Rogue Research
On 2006-08-17 09:15, Philippe Casgrain said:
>>> We've got a cross platform, legacy C++ static library that uses a 'BOOL'
>>> type. For Windows, this is a standard type defined as an int. For Mac,
>>> we define it as a 'bool'.
>>
>> 'BOOL' unfortunately is not the same as 'bool' on the Mac. On
>> PowerPC, 'bool' is four bytes, but BOOL is an unsigned char. On
>> Intel, 'bool' is one byte, but I can't remember if it's signed or
>> unsigned.
>For this very reason (our app is large, legacy, cross-platform) we ended
>up with a "typedef unsigned char Boolean", and every time we write
>something to disk, we use the Boolean type rather than bool or BOOL. It
>really helps with byte-swapping, too!
Salut Philippe!
Beware: "Boolean" is also defined in MacTypes.h:
typedef unsigned char Boolean;
and is used by many Mac OS APIs. Lucky for you your definition is the
same, but for the OP, I think a different name is in order. :)
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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