From a8fbda50e16cdd22539fe9af3e6766778bee7415 Mon Sep 17 00:00:00 2001 From: naruse Date: Fri, 9 Dec 2016 22:45:38 +0000 Subject: 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 --- include/ruby/defines.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'include') 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 */ -- cgit v1.2.3