[cfe-commits] r76130 - /cfe/trunk/www/analyzer/annotations.html

Ted Kremenek kremenek at apple.com
Thu Jul 16 17:26:06 PDT 2009


Author: kremenek
Date: Thu Jul 16 19:25:49 2009
New Revision: 76130

URL: http://llvm.org/viewvc/llvm-project?rev=76130&view=rev
Log:
Update cf_returns_retained/ns_returns_retained examples to use __has_feature.

Modified:
    cfe/trunk/www/analyzer/annotations.html

Modified: cfe/trunk/www/analyzer/annotations.html
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/www/analyzer/annotations.html?rev=76130&r1=76129&r2=76130&view=diff

==============================================================================
--- cfe/trunk/www/analyzer/annotations.html (original)
+++ cfe/trunk/www/analyzer/annotations.html Thu Jul 16 19:25:49 2009
@@ -152,8 +152,12 @@
 <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
@@ -226,8 +230,12 @@
 $ 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





More information about the cfe-commits mailing list