From d79219e189cacabb6dffa5bb9a176619a01bc3ba Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Wed, 24 Feb 2010 01:06:44 +0000 Subject: [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) --- GTMDefines.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'GTMDefines.h') 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 -- cgit v1.2.3