This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] nldbl-compat.c: Include math.h before nldbl-compat.h.


Jeff Law noticed that native PowerPC builds were broken by my having
made math_ldbl_opt.h not include math.h.  nldbl-compat.c formerly got
math.h via libioP.h and math_ldbl_opt.h, *without* __NO_LONG_DOUBLE_MATH;
after my change it got it via nldbl-compat.h *with* __NO_LONG_DOUBLE_MATH,
but __NO_LONG_DOUBLE_MATH mode is forbidden on hosts that define
__HAVE_DISTINCT_FLOAT128, so the build breaks.  I don't know why this
didn't come up in a build-many-glibcs cycle.

I pushed this as a quick fix, but there's a deeper problem: presumably
nldbl-compat.h defines __NO_LONG_DOUBLE_MATH for a reason, but if we
can't use __NO_LONG_DOUBLE_MATH on any architecture that supports
_Float128, then nldbl-compat.h needs to find some other way to achieve
its goal.  Or maybe it's vestigial and we could just stop doing it?
Do we still need __NO_LONG_DOUBLE_MATH at all?  I leave these questions
to people more versed in the intricacies of long double.

	* sysdeps/ieee754/ldbl-opt/nldbl-compat.c: Include math.h
	before nldbl-compat.h.
---
 sysdeps/ieee754/ldbl-opt/nldbl-compat.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-compat.c b/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
index bf54090d4f..ffb5fabebe 100644
--- a/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
@@ -20,6 +20,7 @@
 #include <stdarg.h>
 #include <stdio.h>
 #include <libioP.h>
+#include <math.h>
 #include <wchar.h>
 #include <printf.h>
 #include <monetary.h>
-- 
2.16.2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]