• 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: Why are BOOL and bool distinct types?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why are BOOL and bool distinct types?


  • Subject: Re: Why are BOOL and bool distinct types?
  • From: John Stiles <email@hidden>
  • Date: Sun, 12 Jun 2005 20:19:13 -0700

On Jun 8, 2005, at 7:33 AM, Fritz Anderson wrote:

On 8 Jun 2005, at 9:08 AM, Sean McBride wrote:


Maybe BOOL should be deprecated now that C99 has a native type?


No. BOOL is 8 bits on all platforms; bool is 32 bits on ppc and 8 bits on i386. Native type != better.

One very important platform (Win32) has a 32-bit type called BOOL.
Which means our code needs to do this in its PCH:

#define BOOL BOOL_ObjC
#import <Cocoa/Cocoa.h>
#undef  BOOL

I really hate this hack, but I don't think we have a choice unless we rip BOOL out of the 90% of our codebase which was designed with Win32 in mind. Say what you will, but we work with 10 PC guys and I don't really feel like stepping on all their toes over a goofy Cocoa-ism.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Why are BOOL and bool distinct types? (From: Todd Blanchard <email@hidden>)
 >Re: Why are BOOL and bool distinct types? (From: "Sean McBride" <email@hidden>)
 >Re: Why are BOOL and bool distinct types? (From: Fritz Anderson <email@hidden>)

  • Prev by Date: Re: Stumped on paint bucket in Core Image and polygons in Quartz
  • Next by Date: Viewing code generated Core Data models
  • Previous by thread: Re: Why are BOOL and bool distinct types?
  • Next by thread: Reconnecting IBOutlets from an archive ?
  • Index(es):
    • Date
    • Thread