]> Savannah Git Hosting - gnulib.git/commitdiff
Fix compilation errors in C++ mode on macOS and FreeBSD.
authorBruno Haible <bruno@clisp.org>
Sun, 8 Dec 2019 11:58:13 +0000 (12:58 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 8 Dec 2019 11:58:13 +0000 (12:58 +0100)
* lib/math.in.h (isfinite, isinf, isnan, signbit): In C++ mode on macOS
or FreeBSD with clang, use the approach without C preprocessor macro.

ChangeLog
lib/math.in.h

index bf4139f7ba870e394c2dea1a15de0701f6b2a686..b255e73dd8329e2bd00a61cb4aeb1c12dfdc5f82 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2019-12-08  Bruno Haible  <bruno@clisp.org>
+
+       Fix compilation errors in C++ mode on macOS and FreeBSD.
+       * lib/math.in.h (isfinite, isinf, isnan, signbit): In C++ mode on macOS
+       or FreeBSD with clang, use the approach without C preprocessor macro.
+
 2019-12-07  Bruno Haible  <bruno@clisp.org>
 
        Fix compilation errors in C++ mode on AIX with xlclang++.
index 3bb9663027767953709c4c230e5be250144e73a1..55130ab5a1c577a0827de6c2c0ed58266c06d374 100644 (file)
@@ -2257,7 +2257,7 @@ _GL_EXTERN_C int gl_isfinitel (long double x);
 #  if defined isfinite || defined GNULIB_NAMESPACE
 _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isfinite)
 #   undef isfinite
-#   if __GNUC__ >= 6 || (defined __clang__ && !defined _AIX)
+#   if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined _AIX))
   /* This platform's <cmath> possibly defines isfinite through a set of inline
      functions.  */
 _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isfinite, rpl_isfinite, bool)
@@ -2291,7 +2291,7 @@ _GL_EXTERN_C int gl_isinfl (long double x);
 #  if defined isinf || defined GNULIB_NAMESPACE
 _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isinf)
 #   undef isinf
-#   if __GNUC__ >= 6 || defined __clang__
+#   if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__))
   /* This platform's <cmath> possibly defines isinf through a set of inline
      functions.  */
 _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isinf, rpl_isinf, bool)
@@ -2416,7 +2416,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__
+#   if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__))
   /* This platform's <cmath> possibly defines isnan through a set of inline
      functions.  */
 _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isnan, rpl_isnan, bool)
@@ -2499,7 +2499,7 @@ _GL_EXTERN_C int gl_signbitl (long double arg);
 #  if defined signbit || defined GNULIB_NAMESPACE
 _GL_MATH_CXX_REAL_FLOATING_DECL_1 (signbit)
 #   undef signbit
-#   if __GNUC__ >= 6 || (defined __clang__ && !defined _AIX)
+#   if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined _AIX))
   /* This platform's <cmath> possibly defines signbit through a set of inline
      functions.  */
 _GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit, rpl_signbit, bool)