summaryrefslogtreecommitdiffstats
path: root/lib.h
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
commit4b3b27440fedd2d3c977c930c924a0938609ef9f (patch)
treeebb51fc32524ec3300cb15678363ded04e6ba532 /lib.h
parentde5f1db5838ef74f48fcace02d9d659b4e6d9d32 (diff)
downloadtxr-4b3b27440fedd2d3c977c930c924a0938609ef9f.tar.gz
txr-4b3b27440fedd2d3c977c930c924a0938609ef9f.tar.bz2
txr-4b3b27440fedd2d3c977c930c924a0938609ef9f.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 'lib.h')
-rw-r--r--lib.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib.h b/lib.h
index b61ebac9..646af602 100644
--- a/lib.h
+++ b/lib.h
@@ -95,9 +95,11 @@ typedef double_uintptr_t dbl_ucnum;
#ifdef __GNUC__
#define NORETURN __attribute__((noreturn))
#define NOINLINE __attribute__((noinline))
+#define UNUSED __attribute__((unused))
#else
#define NORETURN
#define NOINLINE
+#define UNUSED
#endif
typedef enum type {