summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-07-15 14:26:01 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-07-15 14:26:01 -0700
commit2f9ed3990a67fcdd9473b862bbb83ab257560610 (patch)
treeebb51fc32524ec3300cb15678363ded04e6ba532 /configure
parentfcf291f31d01e0ce6e821db18d0ea0b9502f679d (diff)
downloadtxr-2f9ed3990a67fcdd9473b862bbb83ab257560610.tar.gz
txr-2f9ed3990a67fcdd9473b862bbb83ab257560610.tar.bz2
txr-2f9ed3990a67fcdd9473b862bbb83ab257560610.zip
Math library: add numerous C99 functions.
* configure: Detect all the new functions, with separate tests for the unary and binary ones. * arith.c (cbrt_s, erf_s, erfc_s, exp10_s, exp2_s, expm1_s, gamma_s, j0_s, j1_s, lgamma_s, log1p_s, logb_s, nearbyint_s, rint_s, significand_s, tgamma_s, y0_s, y1_s, copysign_s, drem_s, fdim_s, fmax_s, fmin_s, hypot_s, jn_s, ldexp_s, nextafter_s, remainder_s, scalb_s, scalbln_s, yn_s, r_copysign_s, r_drem_s, r_fdim_s, r_fmax_s, r_fmin_s, hypot_s, r_jn_s, r_ldexp_s, r_nextafter_s, r_remainder_s, r_scalb_s, scalbln_s, r_yn_s): New symbol variables. (not_available): New static function. (cbrt_wrap, erf_wrap, erfc_wrap, exp10_wrap, exp2_wrap, expm1_wrap, gamma_wrap, j0_wrap, j1_wrap, lgamma_wrap, log1p_wrap, logb_wrap, nearbyint_wrap, rint_wrap, significand_wrap, tgamma_wrap, y0_wrap, y1_wrap, copysign_wrap, drem_wrap, fdim_wrap, fmax_wrap, fmin_wrap, hypot_wrap, jn_wrap, ldexp_wrap, nextafter_wrap, remainder_wrap, scalb_wrap, scalbln_wrap, yn_wrap): New static functions. (arith_set_entries, arith_instantiate): New static functions. (arith_init): Initialize symbols and instantiate functions via autoload mechanism. In a program that doesn't use the functions, we suffer only the overhead of interning the symbols. * lib.h (UNUSED): New macro for GCC unused attribute. * txr.1: Documented. * stdlib/doc-syms.tl: Updated.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure44
1 files changed, 44 insertions, 0 deletions
diff --git a/configure b/configure
index 02468f73..8c39cd4d 100755
--- a/configure
+++ b/configure
@@ -2918,6 +2918,50 @@ else
printf "no\n"
fi
+for fun in cbrt erf erfc exp10 exp2 expm1 \
+ gamma j0 j1 lgamma log1p logb \
+ nearbyint pow10 rint significand tgamma y0 y1
+do
+ printf "Checking for %s function ... " $fun
+ cat > conftest.c <<!
+#include <math.h>
+
+int main(void)
+{
+ double a = $fun(0.5);
+ return 0;
+}
+!
+ if conftest ; then
+ printf "yes\n"
+ printf "#define HAVE_%s 1\n" $(echo $fun | tr '[a-z]' '[A-Z]') >> config.h
+ else
+ printf "no\n"
+ fi
+done
+
+for fun in copysign drem fdim fmax fmin \
+ frexp hypot jn ldexp modf \
+ nextafter nexttoward remainder scalb scalbln yn
+do
+ printf "Checking for %s function ... " $fun
+ cat > conftest.c <<!
+#include <math.h>
+
+int main(void)
+{
+ double a = $fun(0.5, 0.5);
+ return 0;
+}
+!
+ if conftest ; then
+ printf "yes\n"
+ printf "#define HAVE_%s 1\n" $(echo $fun | tr '[a-z]' '[A-Z]') >> config.h
+ else
+ printf "no\n"
+ fi
+done
+
printf "Checking for glob ... "
cat > conftest.c <<!