diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-10 14:20:20 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-10 14:20:20 +0000 |
commit | 97d3b04c9b4ac50f9110001a772d59590a6f6274 (patch) | |
tree | d157ceda039154a8d2859bbdad2f859bb999c7ba /configure.in | |
parent | 50b78ebb982b9e3e3639967c27786557aa5faf14 (diff) | |
download | ruby-97d3b04c9b4ac50f9110001a772d59590a6f6274.tar.gz |
ruby/ruby.h: fix for older gcc
* configure.in (__builtin_choose_expr_constant_p): in gcc 4.8 or
earlier, __builtin_choose_expr() does not consider
__builtin_constant_p(variable) a constant expression.
* include/ruby/ruby.h (RUBY_SAFE_LEVEL_CHECK): fix for older gcc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/configure.in b/configure.in index f4651324fe..efb14e7611 100644 --- a/configure.in +++ b/configure.in @@ -2110,7 +2110,7 @@ main(int argc, char **argv) AC_DEFUN([RUBY_CHECK_BUILTIN_FUNC], [dnl AC_CACHE_CHECK([for $1], AS_TR_SH(rb_cv_builtin_$1), [AC_LINK_IFELSE( - [AC_LANG_PROGRAM([], [$2;])], + [AC_LANG_PROGRAM([int foo;], [$2;])], [AS_TR_SH(rb_cv_builtin_$1)=yes], [AS_TR_SH(rb_cv_builtin_$1)=no])]) if test "${AS_TR_SH(rb_cv_builtin_$1)}" != no; then @@ -2123,6 +2123,7 @@ RUBY_CHECK_BUILTIN_FUNC(__builtin_clz, [__builtin_clz(0)]) RUBY_CHECK_BUILTIN_FUNC(__builtin_clzl, [__builtin_clzl(0)]) RUBY_CHECK_BUILTIN_FUNC(__builtin_clzll, [__builtin_clzll(0)]) RUBY_CHECK_BUILTIN_FUNC(__builtin_choose_expr, [__builtin_choose_expr(0, 0, 0)]) +RUBY_CHECK_BUILTIN_FUNC(__builtin_choose_expr_constant_p, [__builtin_choose_expr(__builtin_constant_p(foo), 0, 0)]) RUBY_CHECK_BUILTIN_FUNC(__builtin_types_compatible_p, [__builtin_types_compatible_p(int, int)]) if test "$ac_cv_func_qsort_r" != no; then |