aboutsummaryrefslogtreecommitdiff
path: root/GTMDefines.h
diff options
context:
space:
mode:
authorGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2013-01-31 13:00:21 +0000
committerGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2013-01-31 13:00:21 +0000
commit0a3fae419f654ceb4c708300f7bd7702cbb12db1 (patch)
treee0dec232c33c7032a194e04847ab8dee3a51f194 /GTMDefines.h
parentb0b27ef99c9e48b9383f06a4128377b6a3bfeb70 (diff)
Fix nonnull detection on older GCC.
DELTA=6 (4 added, 0 deleted, 2 changed)
Diffstat (limited to 'GTMDefines.h')
-rw-r--r--GTMDefines.h8
1 files changed, 6 insertions, 2 deletions
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