From 0a3fae419f654ceb4c708300f7bd7702cbb12db1 Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Thu, 31 Jan 2013 13:00:21 +0000 Subject: Fix nonnull detection on older GCC. DELTA=6 (4 added, 0 deleted, 2 changed) --- GTMDefines.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'GTMDefines.h') diff --git a/GTMDefines.h b/GTMDefines.h index 5a41e6e..c295848 100644 --- a/GTMDefines.h +++ b/GTMDefines.h @@ -341,8 +341,12 @@ #endif #ifndef GTM_NONNULL - #if __has_attribute(nonnull) - #define GTM_NONNULL(x) __attribute__((nonnull x)) + #if defined(__has_attribute) + #if __has_attribute(nonnull) + #define GTM_NONNULL(x) __attribute__((nonnull x)) + #else + #define GTM_NONNULL(x) + #endif #else #define GTM_NONNULL(x) #endif -- cgit v1.2.3