[cfe-dev] Detecting ARC via #if(def)?

marc hoffman mh at elitedev.com
Tue Jun 14 07:34:35 PDT 2011


Thanx, guys!

On Jun 13, 2011, at 6:25 PM, Ted Kremenek wrote:

> On Jun 13, 2011, at 9:14 AM, Eli Friedman wrote:
> 
>> On Mon, Jun 13, 2011 at 8:45 AM, marc hoffman <mh at elitedev.com> wrote:
>>> i'm hoping this is not NDA-covered, but with LLV/Clang itself being open
>>> source i assume it's not:
>>> at WWDC i was told there is a functionality in clang/LLVM to check for
>>> availability of specific features in general, and for whether the current
>>> code is being compiled with ARC or not, specifically, via an #if(def) - the
>>> goal being ro write a piece of code that can compile with and w/o ARC, by
>>> #if(def)ing a handful of retain/release calls.
>>> i was told this was well documented in the clang docs, but i've been unable
>>> to find anything regarding this - is anyone here aware of this featyre (and
>>> of the option to check for that represents ARC) and could point me into the
>>> right direction?
>> 
>> ARC hasn't landed in the public repository yet.
>> 
>> In terms of feature ifdefs, see
>> http://clang.llvm.org/docs/LanguageExtensions.html#feature_check .
> 
> Marc,
> 
> More specifically, you will be able to use:
> 
>  #ifdef __has_feature(objc_arc)
> 
> Cheers,
> Ted

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110614/740c5103/attachment.html>


More information about the cfe-dev mailing list