]> Savannah Git Hosting - gnulib.git/commitdiff
isnan: Fix compilation error in C++ mode on FreeBSD 13.2.
authorBruno Haible <bruno@clisp.org>
Fri, 14 Apr 2023 22:46:57 +0000 (00:46 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 14 Apr 2023 22:46:57 +0000 (00:46 +0200)
* lib/math.in.h (isnan): On FreeBSD 13.2 or newer, don't declare isnan
through _GL_MATH_CXX_REAL_FLOATING_DECL_2.

ChangeLog
lib/math.in.h

index 92de9cde22096cd3e58aef8e701c5a2c17cc9acf..6dd071ed10ae4688a66b1a5cbba38a0604441bd5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-04-14  Bruno Haible  <bruno@clisp.org>
+
+       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-14  Bruno Haible  <bruno@clisp.org>
 
        filemode: Fix double-inclusion guard.
index 1af4d54d2d83f2fb6ea9be59c41ee0a32c95e709..f841a1356e4740be9709d88410da2e7062c8ae6d 100644 (file)
@@ -2633,6 +2633,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