• 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: Weird inline/struct offset problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Weird inline/struct offset problem (From: Allen Cronce <email@hidden>)
 >Re: Weird inline/struct offset problem (From: Eric Albert <email@hidden>)
 >Re: Weird inline/struct offset problem (From: Philippe Casgrain <email@hidden>)

  • Prev by Date: Re: xcode-2.4 cctools-622.3 ld and KEXTs
  • Next by Date: Re: Xcode use 4 cores?
  • Previous by thread: Re: Weird inline/struct offset problem
  • Next by thread: Re: Weird inline/struct offset problem
  • Index(es):
    • Date
    • Thread