From e468da0cd12de75bdafafe295773ecda6551c21a Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 20 Dec 2020 14:41:29 +0100 Subject: [PATCH] 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. --- ChangeLog | 6 ++++++ lib/float.in.h | 3 +++ 2 files changed, 9 insertions(+) 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. */ -- 2.39.5