summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-07-17 00:25:49 +0000
committerTed Kremenek <kremenek@apple.com>2009-07-17 00:25:49 +0000
commit7c701e7d8659b79c011760222b3cd16cddffd06b (patch)
treefa2d510a13a84f8c5fd3f4f35069a36ee2557515 /clang
parente5a068fcb3a93dcb50e979d581df530663e67d84 (diff)
downloadbcm5719-llvm-7c701e7d8659b79c011760222b3cd16cddffd06b.tar.gz
bcm5719-llvm-7c701e7d8659b79c011760222b3cd16cddffd06b.zip
Update cf_returns_retained/ns_returns_retained examples to use __has_feature.
llvm-svn: 76130
Diffstat (limited to 'clang')
-rw-r--r--clang/www/analyzer/annotations.html12
1 files changed, 10 insertions, 2 deletions
diff --git a/clang/www/analyzer/annotations.html b/clang/www/analyzer/annotations.html
index e49c327edd2..819886e822c 100644
--- a/clang/www/analyzer/annotations.html
+++ b/clang/www/analyzer/annotations.html
@@ -152,8 +152,12 @@ use 'cf_returns_retained'.</p>
<span class="command">$ cat test.m</span>
#import &lt;Foundation/Foundation.h&gt;
+#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 @@ collection (<tt>-fobjc-gc-only</tt>).</p>
$ cat test.m
#import &lt;Cocoa/Cocoa.h&gt;
+#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
OpenPOWER on IntegriCloud