ruby-changes:44961
From: naruse <ko1@a...>
Date: Sat, 10 Dec 2016 07:45:47 +0900 (JST)
Subject: [ruby-changes:44961] naruse:r57034 (trunk): Suppress warning: this use of "defined" may not be portable
naruse 2016-12-10 07:45:38 +0900 (Sat, 10 Dec 2016) New Revision: 57034 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57034 Log: 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 Modified files: trunk/include/ruby/defines.h Index: include/ruby/defines.h =================================================================== --- include/ruby/defines.h (revision 57033) +++ include/ruby/defines.h (revision 57034) @@ -62,12 +62,15 @@ extern "C" { https://github.com/ruby/ruby/blob/trunk/include/ruby/defines.h#L62 #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 */ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/