summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-16 05:14:48 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-16 05:14:48 +0000
commit191796051046aa5423585fc027a4c8d470c9438d (patch)
tree94bd5629cd1ab79064226e15685cd602a10e75e6
parent16294913f71b8a38526096cf6458340b19b45f9f (diff)
configure.in: refine __builtin_choose_expr check
* configure.in (__builtin_choose_expr): check more precisely the results. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--configure.in12
1 files changed, 10 insertions, 2 deletions
diff --git a/configure.in b/configure.in
index 6fbc01c3efe..45d8dd212b6 100644
--- a/configure.in
+++ b/configure.in
@@ -2183,8 +2183,16 @@ RUBY_CHECK_BUILTIN_FUNC(__builtin_bswap64, [__builtin_bswap64(0)])
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_choose_expr, [
+ [int x[__extension__(__builtin_choose_expr(1, 1, -1))]];
+ [int y[__extension__(__builtin_choose_expr(0, -1, 1))]];
+ ])
+if test x$rb_cv_builtin___builtin_choose_expr = xyes; then
+ RUBY_CHECK_BUILTIN_FUNC(__builtin_choose_expr_constant_p, [
+ [int x[__extension__(__builtin_choose_expr(__builtin_constant_p(1), 1, -1))]];
+ [int y[__extension__(__builtin_choose_expr(__builtin_constant_p(foo), -1, 1))]];
+ ])
+fi
RUBY_CHECK_BUILTIN_FUNC(__builtin_types_compatible_p, [__builtin_types_compatible_p(int, int)])
if test "$ac_cv_func_qsort_r" != no; then