diff --git a/ChangeLog b/ChangeLog index 71ba8fad1f..99a467559d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Thu Jan 7 22:32:21 2016 Kenta Murata + + * ruby.h: undef HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P + and HAVE_BUILTIN___BUILTIN_TYPES_COMPATIBLE_P on C++. + [ruby-core:72736] [Bug #11962] + Thu Jan 7 22:02:21 2016 Shugo Maeda * enum.c (enum_minmax): optimize object comparison in diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 7aabf5bd68..82dca14682 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -26,6 +26,13 @@ extern "C" { #include RUBY_EXTCONF_H #endif +#if defined(__cplusplus) +/* __builtin_choose_expr and __builtin_types_compatible aren't available + * on C++. See https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html */ +# undef HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P +# undef HAVE_BUILTIN___BUILTIN_TYPES_COMPATIBLE_P +#endif + #include "defines.h" #define NORETURN_STYLE_NEW 1