Re: CGFloat and 64 Bit
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