]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
signbit: Fix compil. error in C++ mode on macOS 14 (regr. 2026-02-03).
authorBruno Haible <bruno@clisp.org>
Mon, 9 Feb 2026 16:53:38 +0000 (17:53 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 9 Feb 2026 16:53:38 +0000 (17:53 +0100)
* lib/math.in.h (signbit): Don't define as a template if the compiler
is clang.

ChangeLog
lib/math.in.h

index 121ff927aa833f2e4dd817cc182877f7a57ab886..9415ff0bf2e94e05b2e051a4333e3f80379b18bd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2026-02-09  Bruno Haible  <bruno@clisp.org>
+
+       signbit: Fix compil. error in C++ mode on macOS 14 (regr. 2026-02-03).
+       * lib/math.in.h (signbit): Don't define as a template if the compiler
+       is clang.
+
 2026-02-09  Bruno Haible  <bruno@clisp.org>
 
        isnan: Fix compilation error in C++ mode on NetBSD (regr. 2026-02-03).
index 4174445d383ab8f2bd68b105794db96df0ec454d..14218ea08c3c8c444be7eac921b0dadcc40477ad 100644 (file)
@@ -2716,7 +2716,7 @@ _GL_WARN_REAL_FLOATING_DECL (isnan);
       && (!defined __cplusplus || __cplusplus < 201103))
 #  undef signbit
    /* GCC >= 4.0 and clang provide three built-ins for signbit.  */
-#  ifdef __cplusplus
+#  if defined __cplusplus && !defined __clang__
 template <typename T> int signbit (T);
 template <> inline int signbit<float> (float x) { return __builtin_signbitf (x); }
 template <> inline int signbit<double> (double x) { return __builtin_signbit (x); }
@@ -2770,7 +2770,7 @@ _GL_EXTERN_C int gl_signbitl (long double arg);
         })
 #   endif
 #  endif
-#  ifdef __cplusplus
+#  if defined __cplusplus && !defined __clang__
 template <typename T> int signbit (T);
 template <> inline int signbit<float> (float x) { return gl_signbitf (x); }
 template <> inline int signbit<double> (double x) { return gl_signbitd (x); }