]> Savannah Git Hosting - gnulib.git/commitdiff
math C++ tests: Fix compilation error in with clang >= 7 on FreeBSD.
authorBruno Haible <bruno@clisp.org>
Wed, 9 Dec 2020 17:08:18 +0000 (18:08 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 9 Dec 2020 17:08:18 +0000 (18:08 +0100)
* lib/math.in.h (isnan): For clang >= 7 on FreeBSD, declare 'rpl_isnan',
not 'isnan'.

ChangeLog
lib/math.in.h

index 59b4b72acd00be68a0ea3ecdb2be60bcaaa3a6ca..817bd1f9ea791c919e8fbf1d5f85e29bbc96d140 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2020-12-09  Bruno Haible  <bruno@clisp.org>
+
+       math C++ tests: Fix compilation error in with clang >= 7 on FreeBSD.
+       * lib/math.in.h (isnan): For clang >= 7 on FreeBSD, declare 'rpl_isnan',
+       not 'isnan'.
+
 2020-12-08  Bruno Haible  <bruno@clisp.org>
 
        std-gnu11: Make compatible with Autoconf 2.70.
index 4090eff35e303a77d178e9e6e95076d2957575a5..ebf2e0dd415b120477387bed7f96bda3012e53c5 100644 (file)
@@ -2566,7 +2566,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__) || defined __FreeBSD__ || defined __OpenBSD__ || (defined _WIN32 && !defined __CYGWIN__)))
+#   if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || (defined __FreeBSD__ && __clang_major__ < 7) || 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)