• 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: Philippe Casgrain <email@hidden>
  • Date: Thu, 17 Aug 2006 09:15:07 -0400

Eric Albert a écrit :
While I don't have a solution for the problems you've described, I do have a few comments....

On Aug 16, 2006, at 12:09 PM, Allen Cronce wrote:

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!

Philippe
_______________________________________________
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: Weird inline/struct offset problem
      • From: "Sean McBride" <email@hidden>
References: 
 >Weird inline/struct offset problem (From: Allen Cronce <email@hidden>)
 >Re: Weird inline/struct offset problem (From: Eric Albert <email@hidden>)

  • Prev by Date: Re: How exactly are we supposed to debug memory problems???
  • Next by Date: Re: How exactly are we supposed to debug memory problems???
  • Previous by thread: Re: Weird inline/struct offset problem
  • Next by thread: Re: Weird inline/struct offset problem
  • Index(es):
    • Date
    • Thread