aboutsummaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-13 01:05:30 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-13 01:05:30 +0000
commit0f4e4aae22b4e7b92b7ca72dc7dab4b22a9752b4 (patch)
tree8adef82b237f5126bc0879cad6f8832a4b96da34 /configure.in
parent6703e236539146ed446c8bb48683f73bc173df31 (diff)
downloadruby-0f4e4aae22b4e7b92b7ca72dc7dab4b22a9752b4.tar.gz
math.c: check argument to lgamma_r
* math.c (math_lgamma): check the argument before calling math function `lgamma_r` for edge cases. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in41
1 files changed, 0 insertions, 41 deletions
diff --git a/configure.in b/configure.in
index 1ca8d142ac..55be1a395b 100644
--- a/configure.in
+++ b/configure.in
@@ -2639,47 +2639,6 @@ main(int argc, char **argv)
])
AS_IF([test "x$rb_cv_atan2_inf_c99" = xyes], [AC_DEFINE(ATAN2_INF_C99)])
-AS_IF([test "x$ac_cv_func_lgamma_r" = xyes], [
- AC_CACHE_CHECK(whether lgamma_r handles +0.0 and -0.0, rb_cv_lgamma_r_pm0, [
- AC_TRY_RUN([
-@%:@include <math.h>
-@%:@ifdef HAVE_UNISTD_H
-@%:@include <unistd.h>
-@%:@endif
-@%:@ifndef EXIT_SUCCESS
-@%:@define EXIT_SUCCESS 0
-@%:@endif
-@%:@ifndef EXIT_FAILURE
-@%:@define EXIT_FAILURE 1
-@%:@endif
-
-int
-main(int argc, char **argv)
-{
- int sign = 0;
- double x = lgamma_r(-0.0, &sign);
-
- /* should be [+inf, -1] */
- if (x <= 0) return EXIT_FAILURE;
- if (!isinf(x)) return EXIT_FAILURE;
- if (sign != -1) return EXIT_FAILURE;
-
- /* should be [+inf, 1] */
- x = lgamma_r(+0.0, &sign);
- if (x <= 0) return EXIT_FAILURE;
- if (!isinf(x)) return EXIT_FAILURE;
- if (sign != 1) return EXIT_FAILURE;
- return EXIT_SUCCESS;
-}
-],
- [rb_cv_lgamma_r_pm0=yes],
- [rb_cv_lgamma_r_pm0=no],
- [rb_cv_lgamma_r_pm0=yes]
- )
- ])
- AS_IF([test "x$rb_cv_lgamma_r_pm0" = xno], [AC_DEFINE(LGAMMA_R_PM0_FIX)])
-])
-
# Some platform need -lrt for clock_gettime, but the other don't.
if test x"$ac_cv_func_clock_gettime" != xyes; then
# glibc 2.17 moves clock_* functions from librt to the main C library.