summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-12 14:57:17 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-12 14:57:17 +0000
commitf0fc13aaeaee741362ba77aa7920e8e63f687de2 (patch)
tree0dea6efb85972ee3fe7b2413970e5de6cfb137e9 /configure.in
parentb063dd016cecace0ca844d1471db668f4f1d6586 (diff)
configure.in: check atan2
* configure.in (rb_cv_atan2_inf_c99): check whether runtime atan2 handles Inf as C99. ruby-core:62536] [Bug #9831] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in29
1 files changed, 29 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index ba40553c3f..cf317af87a 100644
--- a/configure.in
+++ b/configure.in
@@ -2145,6 +2145,35 @@ void qsort_r(void *base, size_t nmemb, size_t size,
])
fi
+AC_CACHE_CHECK(whether atan2 handles Inf as C99, rb_cv_atan2_inf_c99, [
+ AS_IF([test $ac_cv_func_atan2f:$ac_cv_func_atan2l = yes:yes], [
+ 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)
+{
+ if (fabs(atan2(INFINITY, INFINITY) - M_PI_4) <= 0.01) return EXIT_SUCCESS;
+ return EXIT_FAILURE;
+}
+],
+ [rb_cv_atan2_inf_c99=yes],
+ [rb_cv_atan2_inf_c99=no],
+ [AS_CASE($target_os, [mingw*|mswin*], [rb_cv_atan2_inf_c99=no], [rb_cv_atan2_inf_c99=yes])]
+ )
+ ])
+])
+AS_IF([test $rb_cv_atan2_inf_c99 = yes], [AC_DEFINE(ATAN2_INF_C99)])
+
# 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.