From 575f9e440ae8a84c0d53ed6cbeed4e2b422e8d8e Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 15 Apr 2023 00:46:57 +0200 Subject: [PATCH] isnan: Fix compilation error in C++ mode on FreeBSD 13.2. * lib/math.in.h (isnan): On FreeBSD 13.2 or newer, don't declare isnan through _GL_MATH_CXX_REAL_FLOATING_DECL_2. --- ChangeLog | 6 ++++++ lib/math.in.h | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index 71b3e04a80..90b36854c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2023-04-14 Bruno Haible + + isnan: Fix compilation error in C++ mode on FreeBSD 13.2. + * lib/math.in.h (isnan): On FreeBSD 13.2 or newer, don't declare isnan + through _GL_MATH_CXX_REAL_FLOATING_DECL_2. + 2023-04-13 Bruno Haible ialloc, gethrxtime: Restore GCC diagnostics options. diff --git a/lib/math.in.h b/lib/math.in.h index 3d9465828e..235cb32121 100644 --- a/lib/math.in.h +++ b/lib/math.in.h @@ -2623,6 +2623,11 @@ _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isnan) _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isnan, rpl_isnan, bool) # define isnan rpl_isnan # define GNULIB_NAMESPACE_LACKS_ISNAN 1 +# elif (defined __FreeBSD__ && __clang_major__ >= 14) + /* Neither of the two possible _GL_MATH_CXX_REAL_FLOATING_DECL_2 invocations + works. Inline functions are already present in /usr/include/c++/v1/math.h, + which comes from LLVM. */ +# define GNULIB_NAMESPACE_LACKS_ISNAN 1 # else _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isnan, isnan, bool) # endif -- 2.39.5