Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Q] Is there any macro like __OBJC_2__?




On Apr 25, 2008, at 2:06 PM, JongAm Park wrote:
With C++, there is a macro *__cplusplus*. Is there anything analogous for the Objective-C 2.0?

I've used the following test:

#if defined(MAC_OS_X_VERSION_10_5) && (MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MIN_REQUIRED) && defined(__APPLE_CC__) && (__APPLE_CC__ >= 5465)
... statements in ObjC2.0 syntax ...
#else
... statements in pre-2.0 syntax ...
#endif


This is, obviously, very specific to Apple's gcc, but as far as I know there are no other ObjC2 implementations (and within a year or two I won't be trying to support pre-Leopard targets anyway). I agree it would be a good thing if there were an __OBJC_2_0__ macro or similar way for the preprocessor to tell whether the new syntax is usable...


_______________________________________________ Do not post admin requests to the list. They will be ignored. Objc-language mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/objc-language/email@hidden

This email sent to email@hidden
References: 
 >[Q] Is there any macro like __OBJC_2__? (From: JongAm Park <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.