[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: float: Fix compilation error when gnulib's float.h exists twice
From: |
Bruno Haible |
Subject: |
Re: float: Fix compilation error when gnulib's float.h exists twice |
Date: |
Sun, 20 Dec 2020 14:52:36 +0100 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-197-generic; KDE/5.18.0; x86_64; ; ) |
> 2020-12-20 Bruno Haible <bruno@clisp.org>
>
> float: Fix compilation error when gnulib's float.h exists twice.
> Reported by Santiago Vila <sanvila@unex.es>.
> * 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