From 03cd507fb88a3a265978cfe0a367cf69e305c54e Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 8 Dec 2019 12:58:13 +0100 Subject: [PATCH] Fix compilation errors in C++ mode on macOS and FreeBSD. * lib/math.in.h (isfinite, isinf, isnan, signbit): In C++ mode on macOS or FreeBSD with clang, use the approach without C preprocessor macro. --- ChangeLog | 6 ++++++ lib/math.in.h | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index bf4139f7ba..b255e73dd8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2019-12-08 Bruno Haible + + Fix compilation errors in C++ mode on macOS and FreeBSD. + * lib/math.in.h (isfinite, isinf, isnan, signbit): In C++ mode on macOS + or FreeBSD with clang, use the approach without C preprocessor macro. + 2019-12-07 Bruno Haible Fix compilation errors in C++ mode on AIX with xlclang++. diff --git a/lib/math.in.h b/lib/math.in.h index 3bb9663027..55130ab5a1 100644 --- a/lib/math.in.h +++ b/lib/math.in.h @@ -2257,7 +2257,7 @@ _GL_EXTERN_C int gl_isfinitel (long double x); # if defined isfinite || defined GNULIB_NAMESPACE _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isfinite) # undef isfinite -# if __GNUC__ >= 6 || (defined __clang__ && !defined _AIX) +# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined _AIX)) /* This platform's possibly defines isfinite through a set of inline functions. */ _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isfinite, rpl_isfinite, bool) @@ -2291,7 +2291,7 @@ _GL_EXTERN_C int gl_isinfl (long double x); # if defined isinf || defined GNULIB_NAMESPACE _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isinf) # undef isinf -# if __GNUC__ >= 6 || defined __clang__ +# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__)) /* This platform's possibly defines isinf through a set of inline functions. */ _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isinf, rpl_isinf, bool) @@ -2416,7 +2416,7 @@ _GL_EXTERN_C int rpl_isnanl (long double x) _GL_ATTRIBUTE_CONST; # if defined isnan || defined GNULIB_NAMESPACE _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isnan) # undef isnan -# if __GNUC__ >= 6 || defined __clang__ +# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__)) /* This platform's possibly defines isnan through a set of inline functions. */ _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isnan, rpl_isnan, bool) @@ -2499,7 +2499,7 @@ _GL_EXTERN_C int gl_signbitl (long double arg); # if defined signbit || defined GNULIB_NAMESPACE _GL_MATH_CXX_REAL_FLOATING_DECL_1 (signbit) # undef signbit -# if __GNUC__ >= 6 || (defined __clang__ && !defined _AIX) +# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined _AIX)) /* This platform's possibly defines signbit through a set of inline functions. */ _GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit, rpl_signbit, bool) -- 2.39.5