From 98bddfefc1773dc9a0f3771eb65224c26ee66281 Mon Sep 17 00:00:00 2001 From: naruse Date: Sat, 23 Dec 2017 16:17:57 +0000 Subject: undef HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P on GCC 4.8 GCC 4.8 with optimization causes error if it compiles following code. [Bug #14221] ```c __builtin_choose_expr(__builtin_constant_p(b),0,1) ``` https://github.com/ruby/ruby/pull/1778 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- include/ruby/defines.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/ruby/defines.h') diff --git a/include/ruby/defines.h b/include/ruby/defines.h index 84aca93856..2c72a7cb8a 100644 --- a/include/ruby/defines.h +++ b/include/ruby/defines.h @@ -72,6 +72,17 @@ extern "C" { # define GCC_VERSION_SINCE(major, minor, patchlevel) 0 # endif #endif +#ifndef GCC_VERSION_BEFORE +# if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__clang__) +# define GCC_VERSION_BEFORE(major, minor, patchlevel) \ + ((__GNUC__ < (major)) || \ + ((__GNUC__ == (major) && \ + ((__GNUC_MINOR__ < (minor)) || \ + (__GNUC_MINOR__ == (minor) && __GNUC_PATCHLEVEL__ <= (patchlevel)))))) +# else +# define GCC_VERSION_BEFORE(major, minor, patchlevel) 0 +# endif +#endif /* likely */ #if __GNUC__ >= 3 -- cgit v1.2.3