<span class="command">$ cat test.m</span>
#import <Foundation/Foundation.h>
+#ifndef __has_feature // Optional.
+#define __has_feature(x) 0 // Compatibility with non-clang compilers.
+#endif
+
#ifndef NS_RETURNS_RETAINED
-#if __clang__
+#if __has_feature(attribute_ns_returns_retained)
<span class="code_highlight">#define NS_RETURNS_RETAINED __attribute__((ns_returns_retained))</span>
#else
#define NS_RETURNS_RETAINED
$ cat test.m
#import <Cocoa/Cocoa.h>
+#ifndef __has_feature // Optional.
+#define __has_feature(x) 0 // Compatibility with non-clang compilers.
+#endif
+
#ifndef CF_RETURNS_RETAINED
-#if __clang__
+#if __has_feature(attribute_cf_returns_retained)
<span class="code_highlight">#define CF_RETURNS_RETAINED __attribute__((cf_returns_retained))</span>
#else
#define CF_RETURNS_RETAINED