aboutsummaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
Diffstat (limited to 'math')
-rw-r--r--math/Makefile6
-rw-r--r--math/math.h25
2 files changed, 20 insertions, 11 deletions
diff --git a/math/Makefile b/math/Makefile
index c47a3a4a9f..01345fb775 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -22,15 +22,15 @@ subdir := math
include ../Makeconfig
# Installed header files.
-headers := math.h bits/mathcalls.h bits/mathinline.h bits/huge_val.h \
- bits/huge_valf.h bits/huge_vall.h bits/inf.h bits/nan.h \
+headers := math.h bits/mathcalls.h bits/mathinline.h \
+ bits/inf.h bits/nan.h \
fpu_control.h complex.h bits/cmathcalls.h fenv.h \
bits/fenv.h bits/fenvinline.h bits/mathdef.h tgmath.h \
bits/math-finite.h bits/math-vector.h \
bits/libm-simd-decl-stubs.h bits/iscanonical.h \
bits/flt-eval-method.h bits/fp-fast.h bits/fp-logb.h \
bits/long-double.h bits/mathcalls-helper-functions.h \
- bits/floatn.h bits/huge_val_flt128.h
+ bits/floatn.h
# FPU support code.
aux := setfpucw fpu_control
diff --git a/math/math.h b/math/math.h
index 7e41b0dd3a..dcccf8ea8c 100644
--- a/math/math.h
+++ b/math/math.h
@@ -37,18 +37,27 @@ __BEGIN_DECLS
/* Gather machine dependent type support. */
#include <bits/floatn.h>
-/* Get machine-dependent HUGE_VAL value (returned on overflow).
- On all IEEE754 machines, this is +Infinity. */
-#include <bits/huge_val.h>
-
+/* Value returned on overflow. On all IEEE754 machines, this is
+ +Infinity. */
+#if __GNUC_PREREQ (3, 3)
+# define HUGE_VAL (__builtin_huge_val ())
+#else
+# define HUGE_VAL 1e10000
+#endif
+#ifdef __USE_ISOC99
+# if __GNUC_PREREQ (3, 3)
+# define HUGE_VALF (__builtin_huge_valf ())
+# define HUGE_VALL (__builtin_huge_vall ())
+# else
+# define HUGE_VALF 1e10000f
+# define HUGE_VALL 1e10000L
+# endif
+#endif
#if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
-# include <bits/huge_val_flt128.h>
+# define HUGE_VAL_F128 (__builtin_huge_valf128 ())
#endif
#ifdef __USE_ISOC99
-# include <bits/huge_valf.h>
-# include <bits/huge_vall.h>
-
/* Get machine-dependent INFINITY value. */
# include <bits/inf.h>