]> git.saurik.com Git - apple/libdispatch.git/blobdiff - os/object.h
libdispatch-339.92.1.tar.gz
[apple/libdispatch.git] / os / object.h
index 7d1e5ce85d99e8d8f1042c2559fdc33772f46338..f8d23a3a1955f7a081b9bf6e63e2abb248465453 100644 (file)
  *
  * This mode requires a platform with the modern Objective-C runtime, the
  * Objective-C GC compiler option to be disabled, and at least a Mac OS X 10.8
- * deployment target.
+ * or iOS 6.0 deployment target.
  */
 
 #ifndef OS_OBJECT_HAVE_OBJC_SUPPORT
-#if defined(__OBJC2__) && !defined(__OBJC_GC__) && ( \
+#if defined(__OBJC__) && defined(__OBJC2__) && !defined(__OBJC_GC__) && ( \
                __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_8 || \
                __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0)
 #define OS_OBJECT_HAVE_OBJC_SUPPORT 1
@@ -71,7 +71,7 @@
 #endif
 
 #if OS_OBJECT_USE_OBJC
-#import <Foundation/NSObject.h>
+#import <objc/NSObject.h>
 #define OS_OBJECT_CLASS(name) OS_##name
 #define OS_OBJECT_DECL(name, ...) \
                @protocol OS_OBJECT_CLASS(name) __VA_ARGS__ \
                typedef NSObject<OS_OBJECT_CLASS(name)> *name##_t
 #define OS_OBJECT_DECL_SUBCLASS(name, super) \
                OS_OBJECT_DECL(name, <OS_OBJECT_CLASS(super)>)
-#if defined(__has_attribute) && __has_attribute(ns_returns_retained)
+#if defined(__has_attribute)
+#if __has_attribute(ns_returns_retained)
 #define OS_OBJECT_RETURNS_RETAINED __attribute__((__ns_returns_retained__))
 #else
 #define OS_OBJECT_RETURNS_RETAINED
 #endif
-#if defined(__has_feature) && __has_feature(objc_arc)
+#else
+#define OS_OBJECT_RETURNS_RETAINED
+#endif
+#if defined(__has_feature)
+#if __has_feature(objc_arc)
 #define OS_OBJECT_BRIDGE __bridge
 #else
 #define OS_OBJECT_BRIDGE
 #endif
+#else
+#define OS_OBJECT_BRIDGE
+#endif
 #ifndef OS_OBJECT_USE_OBJC_RETAIN_RELEASE
-#if defined(__has_feature) && __has_feature(objc_arc) || \
-               defined(__clang_analyzer__)
+#if defined(__clang_analyzer__)
+#define OS_OBJECT_USE_OBJC_RETAIN_RELEASE 1
+#elif defined(__has_feature)
+#if __has_feature(objc_arc)
 #define OS_OBJECT_USE_OBJC_RETAIN_RELEASE 1
 #else
 #define OS_OBJECT_USE_OBJC_RETAIN_RELEASE 0
 #endif
+#else
+#define OS_OBJECT_USE_OBJC_RETAIN_RELEASE 0
+#endif
 #endif
 #else
 /*! @parseOnly */