summaryrefslogtreecommitdiff
path: root/include/ruby
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-09 22:45:38 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-09 22:45:38 +0000
commit1f63c0fcb834eb0606c80501d82c1e41e020aefd (patch)
tree3d4f9886b200737b8ac5e1cf5b7ac960f7ac07f7 /include/ruby
parentc047f58da658ee25b5d110e274daa6ca172e6aae (diff)
downloadruby-1f63c0fcb834eb0606c80501d82c1e41e020aefd.tar.gz
Suppress warning: this use of "defined" may not be portable
Use of defined() in macro expansion is considered non portable. https://gcc.gnu.org/ml/gcc-patches/2014-10/msg01577.html git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby')
-rw-r--r--include/ruby/defines.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/include/ruby/defines.h b/include/ruby/defines.h
index 89e549ec19..a4da7ea014 100644
--- a/include/ruby/defines.h
+++ b/include/ruby/defines.h
@@ -62,12 +62,15 @@ extern "C" {
#endif
#ifndef GCC_VERSION_SINCE
-#define GCC_VERSION_SINCE(major, minor, patchlevel) \
- (defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__clang__) && \
- ((__GNUC__ > (major)) || \
- ((__GNUC__ == (major) && \
- ((__GNUC_MINOR__ > (minor)) || \
- (__GNUC_MINOR__ == (minor) && __GNUC_PATCHLEVEL__ >= (patchlevel)))))))
+# if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__clang__)
+# define GCC_VERSION_SINCE(major, minor, patchlevel) \
+ ((__GNUC__ > (major)) || \
+ ((__GNUC__ == (major) && \
+ ((__GNUC_MINOR__ > (minor)) || \
+ (__GNUC_MINOR__ == (minor) && __GNUC_PATCHLEVEL__ >= (patchlevel))))))
+# else
+# define GCC_VERSION_SINCE(major, minor, patchlevel) 0
+# endif
#endif
/* likely */