aboutsummaryrefslogtreecommitdiffstats
path: root/internal.h
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-12 18:12:47 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-12 18:12:47 +0000
commit343406dba1251821610fd1d05b05fd2e9d1dd0cc (patch)
treeacabf7d5525dc45491be3a800aee5050b00a2e68 /internal.h
parent65f0c3240c06f9cdd4c6d87bf285d7b7cdb96dd8 (diff)
downloadruby-343406dba1251821610fd1d05b05fd2e9d1dd0cc.tar.gz
include/ruby/defines.h (GCC_VERSION_SINCE): moved from internal.h
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'internal.h')
-rw-r--r--internal.h8
1 files changed, 1 insertions, 7 deletions
diff --git a/internal.h b/internal.h
index 001a385a69..78ae77d806 100644
--- a/internal.h
+++ b/internal.h
@@ -40,7 +40,7 @@ extern "C" {
#if __has_attribute(__warn_unused_result__)
#define WARN_UNUSED_RESULT(x) x __attribute__((__warn_unused_result__))
-#elif defined(__GNUC__) && (__GNUC__ * 1000 + __GNUC_MINOR__) >= 3004
+#elif GCC_VERSION_SINCE(3,4,0)
#define WARN_UNUSED_RESULT(x) x __attribute__((__warn_unused_result__))
#else
#define WARN_UNUSED_RESULT(x) x
@@ -61,12 +61,6 @@ extern "C" {
#define numberof(array) ((int)(sizeof(array) / sizeof((array)[0])))
-#define GCC_VERSION_SINCE(major, minor, patchlevel) \
- (defined(__GNUC__) && !defined(__INTEL_COMPILER) && \
- ((__GNUC__ > (major)) || \
- (__GNUC__ == (major) && __GNUC_MINOR__ > (minor)) || \
- (__GNUC__ == (major) && __GNUC_MINOR__ == (minor) && __GNUC_PATCHLEVEL__ >= (patchlevel))))
-
#ifndef __has_feature
# define __has_feature(x) 0
#endif