From c2b2754fd365c27d488604edd42cacfff7d5d360 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 13 Apr 2019 00:17:58 +0200 Subject: [PATCH] signbit: Fix compilation error when gnulib's math.h exists twice. * lib/math.in.h (GNULIB_defined_signbit): New macro. --- ChangeLog | 5 +++++ lib/math.in.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 747fd2fcc2..641224193e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2019-04-12 Bruno Haible + + signbit: Fix compilation error when gnulib's math.h exists twice. + * lib/math.in.h (GNULIB_defined_signbit): New macro. + 2019-04-12 Bruno Haible openmp: Fix compilation error on platforms without OpenMP. diff --git a/lib/math.in.h b/lib/math.in.h index aa03ea3a04..99a2c6a979 100644 --- a/lib/math.in.h +++ b/lib/math.in.h @@ -2379,7 +2379,7 @@ _GL_WARN_REAL_FLOATING_DECL (isnan); sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \ __builtin_signbitf (x)) # endif -# if @REPLACE_SIGNBIT@ +# if @REPLACE_SIGNBIT@ && !GNULIB_defined_signbit # undef signbit _GL_EXTERN_C int gl_signbitf (float arg); _GL_EXTERN_C int gl_signbitd (double arg); @@ -2422,6 +2422,7 @@ _GL_EXTERN_C int gl_signbitl (long double arg); (sizeof (x) == sizeof (long double) ? gl_signbitl (x) : \ sizeof (x) == sizeof (double) ? gl_signbitd (x) : \ gl_signbitf (x)) +# define GNULIB_defined_signbit 1 # endif # ifdef __cplusplus # if defined signbit || defined GNULIB_NAMESPACE -- 2.39.5