• 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 NS_BUILD_32_LIKE_64
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >CGFloat and NS_BUILD_32_LIKE_64 (From: Rick Mann <email@hidden>)

  • Prev by Date: Re: CGFloat and NS_BUILD_32_LIKE_64
  • Next by Date: Re: Converting from scalar to NSNumber*
  • Previous by thread: Re: CGFloat and NS_BUILD_32_LIKE_64
  • Next by thread: Converting from scalar to NSNumber*
  • Index(es):
    • Date
    • Thread