]> 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, 21 Apr 2023 02:07:20 +0000 (04:07 +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 5ca121c7e11b976ceb2f7674f5201ad5fe79f613..9b42075c72b22db153b4124b40595198be68014f 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-13  Bruno Haible  <bruno@clisp.org>
 
        ialloc, gethrxtime: Restore GCC diagnostics options.
index 3d9465828e845c0a5404d8b54a0e271716f0fdc3..235cb32121ca08ee3033477b196e9601bb172eb4 100644 (file)
@@ -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