// ARC is compatible with iOS 4.0 upwards, but you need at least Xcode 4.2 with Clang LLVM 3.0 to compile it. | |
#if !defined(__clang__) || __clang_major__ < 3 || !__has_feature(objc_arc) | |
#error This project must be compiled with ARC (Xcode 4.2+ with LLVM 3.0 and above) | |
#endif |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
jverkoey
commented
Dec 5, 2011
Solid. Adding this to the Nimbus arc branch. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
steipete
Dec 5, 2011
Cool! Note that usually !__has_feature(objc_arc) should be enough, other checks were added at a time w/o arc, when i had troubles with gcc. Not sure if they make sens, I don' t believe apple will ever add ARC-support to gcc.
Cool! Note that usually !__has_feature(objc_arc) should be enough, other checks were added at a time w/o arc, when i had troubles with gcc. Not sure if they make sens, I don' t believe apple will ever add ARC-support to gcc. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
ghost
Dec 5, 2011
The recommended idiom for checking features is:
#ifndef __has_feature // Optional of course.
#define __has_feature(x) 0 // Compatibility with non-clang compilers.
#endif
i.e., there’s no need to check for Clang specifically. Having done that, one can safely use __has_feature(), e.g.
#if !__has_feature(objc_arc)
#error …
#endif
ghost
commented
Dec 5, 2011
The recommended idiom for checking features is:
i.e., there’s no need to check for Clang specifically. Having done that, one can safely use __has_feature(), e.g.
|
Solid. Adding this to the Nimbus arc branch.