Re: CGFloat and NS_BUILD_32_LIKE_64
Re: CGFloat and NS_BUILD_32_LIKE_64
- Subject: Re: CGFloat and NS_BUILD_32_LIKE_64
- From: Greg Parker <email@hidden>
- Date: Fri, 27 Feb 2015 16:35:16 -0800
> On Feb 27, 2015, at 4:14 PM, Rick Mann <email@hidden> wrote:
>
> I thought setting NS_BUILD_32_LIKE_64 = 1 would make CGFloat be double, but CGFloat seems to be conditionalized on __LP64__ (at least, on iOS.
>
> I'm building iOS for both 32 and 64 bit devices. What should I do here? I'm trying to get rid of a bunch of implicit conversion warnings. Thanks.
NS_BUILD_32_LIKE_64 can't do that. `float` and `double` have different sizes on all architectures. If NS_BUILD_32_LIKE_64 redefined CGFloat then it would break things like struct CGRect.
NS_BUILD_32_LIKE_64 does only one thing: it changes NSInteger from `long` to `int` and NSUInteger from `unsigned long` to `unsigned int`. That has no effect on storage size on 32-bit; it only changes things like C++ overloading and Objective-C @encode strings that most code won't notice.
https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Cocoa64BitGuide/64BitChangesCocoa/64BitChangesCocoa.html#//apple_ref/doc/uid/TP40004247-CH4-SW2
--
Greg Parker email@hidden Runtime Wrangler
_______________________________________________
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