@@ -4,7 +4,7 @@
#include <sys/reent.h>
#include <sys/cdefs.h>
-#include <machine/ieeefp.h>
+#include <ieeefp.h>
#include "_ansi.h"
_BEGIN_STD_C
@@ -3,6 +3,7 @@
#include <machine/ieeefp.h> /* floating point macros */
#include <sys/features.h> /* POSIX defs */
+#include <float.h>
#ifdef __aarch64__
#define MALLOC_ALIGNMENT 16
@@ -297,4 +298,13 @@
#define _MB_EXTENDED_CHARSETS_WINDOWS 1
#endif
+/* Figure out if long double is the same size as double. If the system
+ * doesn't provide long double, then those values will be undefined
+ * and cpp will substitute 0 for them in the test
+ */
+#if LDBL_MANT_DIG == DBL_MANT_DIG && LDBL_MIN_EXP == DBL_MIN_EXP && \
+ LDBL_MAX_EXP == DBL_MAX_EXP
+#define _LDBL_EQ_DBL
+#endif
+
#endif /* __SYS_CONFIG_H__ */
Do this instead of computing it at configure time to avoid having a compiler-option-specific value installed in newlib.h on a multilib system. v2: Move test to sys/config.h which should always get included whereever this is needed in both the library and applications using the library. Signed-off-by: Keith Packard <keithp@keithp.com> --- newlib/libc/include/math.h | 2 +- newlib/libc/include/sys/config.h | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) -- 2.19.0