diff options
-rw-r--r-- | GTMDefines.h | 26 | ||||
-rw-r--r-- | ReleaseNotes.txt | 3 |
2 files changed, 29 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 diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 06a8c1d..dee7f93 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -399,6 +399,9 @@ Changes since 1.5.1 - Removed GTMTheme because it wasn't generic enough for inclusion in GTM, and was never fully implemented +- Added GTM_NONNULL, NS_RETURNS_RETAINED, and CF_RETURNS_RETAINED macrs to + support clang analysis. + Release 1.5.1 Changes since 1.5.0 |