[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
math C++ tests: Fix compilation error with clang on FreeBSD 13
From: |
Bruno Haible |
Subject: |
math C++ tests: Fix compilation error with clang on FreeBSD 13 |
Date: |
Sat, 03 Sep 2022 00:56:36 +0200 |
On FreeBSD 13.0, I get this compilation error:
In file included from ../../gltests/test-math-c++2.cc:20:
/usr/include/c++/v1/cmath:325:7: error: no member named 'rpl_isnan' in the
global namespace; did you mean 'gnulib::rpl_isnan'?
using ::isnan;
^~
../gllib/math.h:3104:43: note: 'gnulib::rpl_isnan' declared here
_GL_MATH_CXX_REAL_FLOATING_DECL_2 (isnan, rpl_isnan, bool)
^
1 error generated.
*** Error code 1
The fix is to revert the change from 2020-12-09, that was done for
FreeBSD 12.2, for versions of FreeBSD ≥ 13.
2022-09-02 Bruno Haible <bruno@clisp.org>
math C++ tests: Fix compilation error with clang on FreeBSD 13.
* lib/math.in.h (isnan): For clang >= 11 on FreeBSD, declare 'isnan',
not 'rpl_isnan'.
diff --git a/lib/math.in.h b/lib/math.in.h
index a74a95da3e..270e71f414 100644
--- a/lib/math.in.h
+++ b/lib/math.in.h
@@ -2591,7 +2591,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__ && !((defined __APPLE__ && defined
__MACH__ && __clang_major__ < 12) || (defined __FreeBSD__ && __clang_major__ <
7) || defined __OpenBSD__ || (defined _WIN32 && !defined __CYGWIN__)))
+# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined
__MACH__ && __clang_major__ < 12) || (defined __FreeBSD__ && (__clang_major__ <
7 || __clang_major__ >= 11)) || defined __OpenBSD__ || (defined _WIN32 &&
!defined __CYGWIN__)))
/* This platform's <cmath> possibly defines isnan through a set of inline
functions. */
_GL_MATH_CXX_REAL_FLOATING_DECL_2 (isnan, rpl_isnan, bool)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- math C++ tests: Fix compilation error with clang on FreeBSD 13,
Bruno Haible <=