Re: How do I get NSRect to be the same as CGRect?
Re: How do I get NSRect to be the same as CGRect?
- Subject: Re: How do I get NSRect to be the same as CGRect?
- From: "Clark Cox" <email@hidden>
- Date: Sun, 16 Dec 2007 16:29:44 -0800
On Dec 16, 2007 3:46 PM, Rick Mann <email@hidden> wrote:
> In NSGeometry.h, there is some code that switches based on (__LP64__
> || NS_BUILD_32_LIKE_64), and if that's true, does:
>
> typedef CGRect NSRect;
>
>
> Otherwise, it defines NSRect explicitly. I don't understand why it
> does this, and it would make it easier if it just used the typedef.
Before Leopard, NSRect and CGRect were completely different types.
Apple took the opportunity provided by the transition to 64-bit to
eliminate the discrepancy. But this change could break binary
compatibility, so it couldn't be done across the board for 32-bit
code.
> What do those flags mean, and is there a way for my code to get the
> typedef version?
Yes, just define NS_BUILD_32_LIKE_64. This was the first link on
Google when searching for "NS_BUILD_32_LIKE_64":
<http://developer.apple.com/documentation/Cocoa/Conceptual/Cocoa64BitGuide/64BitChangesCocoa/chapter_3_section_3.html>
--
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