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 ++++++++++++++++++++++++++ ReleaseNotes.txt | 3 +++ 2 files changed, 29 insertions(+) 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 -- cgit v1.2.3