aboutsummaryrefslogtreecommitdiff
path: root/GTMDefines.h
diff options
context:
space:
mode:
authorGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2010-02-24 01:06:44 +0000
committerGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2010-02-24 01:06:44 +0000
commitd79219e189cacabb6dffa5bb9a176619a01bc3ba (patch)
tree71eb2ee83443ab1bf21dfc9ac0acd16eb4c8e7c8 /GTMDefines.h
parent5e4fe67110313309e6b970f987e15a8639958fb4 (diff)
[Author: dmaclach]
Some stuff we don't need in GTM right now, but will be useful in QSB, and seemed to make sense as part of the lower level toolkit. R=thomasvl DELTA=26 (26 added, 0 deleted, 0 changed)
Diffstat (limited to 'GTMDefines.h')
-rw-r--r--GTMDefines.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/GTMDefines.h b/GTMDefines.h
index 65693ea..4090aa3 100644
--- a/GTMDefines.h
+++ b/GTMDefines.h
@@ -259,3 +259,29 @@ GTM_EXTERN void _GTMUnitTestDevLog(NSString *format, ...);
#define CGFLOAT_DEFINED 1
#endif // CGFLOAT_DEFINED
#endif // MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
+
+// Some support for advanced clang static analysis functionality
+// See http://clang-analyzer.llvm.org/annotations.html
+#ifndef __has_feature // Optional.
+ #define __has_feature(x) 0 // Compatibility with non-clang compilers.
+#endif
+
+#ifndef NS_RETURNS_RETAINED
+ #if __has_feature(attribute_ns_returns_retained)
+ #define NS_RETURNS_RETAINED __attribute__((ns_returns_retained))
+ #else
+ #define NS_RETURNS_RETAINED
+ #endif
+#endif
+
+#ifndef CF_RETURNS_RETAINED
+ #if __has_feature(attribute_cf_returns_retained)
+ #define CF_RETURNS_RETAINED __attribute__((cf_returns_retained))
+ #else
+ #define CF_RETURNS_RETAINED
+ #endif
+#endif
+
+#ifndef GTM_NONNULL
+ #define GTM_NONNULL(x) __attribute__((nonnull(x)))
+#endif