If it's only NSLog formatting that's an issue, a trick we use for 
cross-platform printfs is a conditional macro (this is off the top of my head; 
ours is conditional on Windows or Mac/Linux):

#if __LP64__
#define FMT_NSUInt "%lu"
#else
#define FMT_NSUInt "%u"
#endif

NSLog(@"u = "FMT_NSUInt" etc", u);


----- Original Message -----
From: "Gerriet M. Denkmann" <gerr...@mdenkmann.de>
To: cocoa-dev@lists.apple.com
Sent: Saturday, June 11, 2011 12:54:39 AM
Subject: NS_BUILD_32_LIKE_64

When I define NS_BUILD_32_LIKE_64=1 I can simply write:

NSUInteger u = 12;
NSLog(@"u = %lu", u );

Otherwise I would need to use a cast like:
NSLog(@"u = %lu", (unsigned long)u );

or even more clumsy:

#if __LP64__ 
        NSLog(@"u = %lu", u );
#else
        NSLog(@"u = %u", u );
#endif

The 64-Bit Transition Guide for Cocoa just says:
"The NS_BUILD_32_LIKE_64 macro is useful when binary compatibility is not a 
concern, such as when building an application."

So: why is this NS_BUILD_32_LIKE_64 not always defined (as default) and what 
binary compatibility issues I have to be aware of?


Kind regards,

Gerriet.



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/lrucker%40vmware.com

This email sent to lruc...@vmware.com
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to