Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Predefined macro for ARC
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Predefined macro for ARC



On Aug 18, 2011, at 8:49 AM, Jon Gary wrote:

> Is there a predefined macro in clang for ARC to conditionally compile edits for ARC?

Quoting Greg Parker from the devforums:

The LLVM Compiler's checks are called __has_feature. ARC is one of the features you can check for.

#ifndef __has_feature
// not LLVM Compiler
#define __has_feature(x) 0
#endif

#if __has_feature(objc_arc)
// compiling with ARC
#else
// compiling without ARC
#endif

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Predefined macro for ARC (From: Jon Gary <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.