• 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: CGFloat and 64 Bit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CGFloat and 64 Bit


  • Subject: Re: CGFloat and 64 Bit
  • From: Clark Cox <email@hidden>
  • Date: Mon, 9 Feb 2009 11:24:33 -0800

On Mon, Feb 9, 2009 at 10:04 AM, Sean McBride <email@hidden> wrote:
> On 2/8/09 11:14 PM, Clark Cox said:
>
>>> A somehow related question:
>>> How does one find out, in which mode (32 vs. 64 bit) an app is running?
>>
>>#ifdef __LP64__
>
> Apple's headers inconsistently use #if and #ifdef.

Because #if and #ifdef will both give the proper result in this
instance (i.e. the GCC compiler either defines __LP64__ to true, or it
doesn't define it at all), they are interchangeable.

> I recommend:
>
> #if defined (__LP64__) && __LP64__

FYI, there is no functional difference between:

#if defined (SOMEMACRO) && SOMEMACRO

and

#if SOMEMACRO

That is, the preprocessor treats any undefined identifier in an '#if'
or '#elif" as if it were defined to be zero.

> which will also not warn with -Wundef.

My original #ifdef won't trigger this warning either, therefore it is
the best of all options (i.e. it's concise, doesn't trigger warnings,
and provides the correct result).

--
Clark S. Cox III
email@hidden
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: CGFloat and 64 Bit
      • From: "Sean McBride" <email@hidden>
References: 
 >CGFloat and 64 Bit (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: CGFloat and 64 Bit (From: Rob Keniger <email@hidden>)
 >Re: CGFloat and 64 Bit (From: Jean-Daniel Dupas <email@hidden>)
 >Re: CGFloat and 64 Bit (From: Rob Keniger <email@hidden>)
 >Re: CGFloat and 64 Bit (From: Jean-Daniel Dupas <email@hidden>)
 >Re: CGFloat and 64 Bit (From: Rob Keniger <email@hidden>)
 >Re: CGFloat and 64 Bit (From: Jean-Daniel Dupas <email@hidden>)
 >Re: CGFloat and 64 Bit (From: "Sean McBride" <email@hidden>)

  • Prev by Date: Re: Determining if a user is logged in from a Launchd Daemon
  • Next by Date: Re: Constrained layer-backed control stops responding
  • Previous by thread: Re: CGFloat and 64 Bit
  • Next by thread: Re: CGFloat and 64 Bit
  • Index(es):
    • Date
    • Thread