summaryrefslogtreecommitdiff
path: root/internal.h
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-12 18:12:47 (GMT)
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-12 18:12:47 (GMT)
commitb207e7cd1def68d729ef878dccac8974f0e5b753 (patch)
treeacabf7d5525dc45491be3a800aee5050b00a2e68 /internal.h
parent07dd6fcc96d4903ec6126b93004c3273dd2e28bf (diff)
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 001a385..78ae77d 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