> 2020-12-20 Bruno Haible <[email protected]>
>
> float: Fix compilation error when gnulib's float.h exists twice.
> Reported by Santiago Vila <[email protected]>.
> * lib/float.in.h (GNULIB_defined_long_double_union): New macro.
Oops, that was only half of the necessary patch. Part 2 is:
diff --git a/lib/float.in.h b/lib/float.in.h
index 7988cc7..6b57ce6 100644
--- a/lib/float.in.h
+++ b/lib/float.in.h
@@ -149,11 +149,14 @@ extern const union gl_long_double_union gl_LDBL_MAX;
Unfortunately, this is not a constant expression, and the latter expression
does not work well when GCC is optimizing.. */
+# if !GNULIB_defined_long_double_union
union gl_long_double_union
{
struct { double hi; double lo; } dd;
long double ld;
};
+# define GNULIB_defined_long_double_union 1
+# endif
extern const union gl_long_double_union gl_LDBL_MAX;
# define LDBL_MAX (gl_LDBL_MAX.ld)
#endif