summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-26 06:06:19 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-26 06:06:19 +0000
commit165ebcb4675f7fc5cd536da586835a6cf46e0da3 (patch)
tree5fe047dee264ae5e522a2e4e563eae4f1622988c
parent2bf5be1db569ed4f7d4633fe7d56e585ae6adf52 (diff)
Fix compilation on gcc 4.6
if __has_feature is not defined, it can't compile git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--gc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gc.c b/gc.c
index e2321c3..34c06a8 100644
--- a/gc.c
+++ b/gc.c
@@ -31,8 +31,12 @@
#include <sys/types.h>
#include <assert.h>
-#if /* is ASAN enabled? */ defined(__has_feature) ? \
- __has_feature(address_sanitizer) /* Clang */ : \
+#ifndef __has_feature
+# define __has_feature(x) 0
+#endif
+
+#if /* is ASAN enabled? */ \
+ __has_feature(address_sanitizer) /* Clang */ || \
defined(__SANITIZE_ADDRESS__) /* GCC 4.8.x */
#define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS \
__attribute__((no_address_safety_analysis)) \