From: Bruno Haible Date: Sun, 20 Dec 2020 13:41:29 +0000 (+0100) Subject: float: Fix compilation error when gnulib's float.h exists twice. X-Git-Tag: v1.0~3346 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=e468da0cd12de75bdafafe295773ecda6551c21a;p=gnulib.git float: Fix compilation error when gnulib's float.h exists twice. Reported by Santiago Vila . * lib/float.in.h (GNULIB_defined_long_double_union): New macro. --- diff --git a/ChangeLog b/ChangeLog index 0d8c2ee6d7..c9f4f8abed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2020-12-20 Bruno Haible + + float: Fix compilation error when gnulib's float.h exists twice. + Reported by Santiago Vila . + * lib/float.in.h (GNULIB_defined_long_double_union): New macro. + 2020-12-19 Bruno Haible free-posix: Assume future POSIX compliance only on OpenBSD and Solaris. diff --git a/lib/float.in.h b/lib/float.in.h index 8e4d47dc07..7988cc790d 100644 --- a/lib/float.in.h +++ b/lib/float.in.h @@ -93,11 +93,14 @@ extern const long double LDBL_MAX; Unfortunately, this is not a constant expression. */ +# if !GNULIB_defined_long_double_union union gl_long_double_union { struct { unsigned int lo; unsigned int hi; unsigned int exponent; } xd; 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) /* Minimum e such that 10^e is in the range of normalized numbers. */