]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
signal.h: Fix compilation error on Solaris 10 in C++ mode.
authorBruno Haible <bruno@clisp.org>
Sun, 10 May 2026 15:04:19 +0000 (17:04 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 10 May 2026 15:04:19 +0000 (17:04 +0200)
* lib/signal.in.h: On Solaris in C++ mode, don't include <pthread.h>.
The include <pthread.h> is only needed for Solaris versions < 9.

ChangeLog
lib/signal.in.h

index 0e96accffa3d30379761fad4bf267c27ef22d810..0187be41483665cf7450767e988c7a994c5ee55b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2026-05-10  Bruno Haible  <bruno@clisp.org>
+
+       signal.h: Fix compilation error on Solaris 10 in C++ mode.
+       * lib/signal.in.h: On Solaris in C++ mode, don't include <pthread.h>.
+       The include <pthread.h> is only needed for Solaris versions < 9.
+
 2026-05-10  Bruno Haible  <bruno@clisp.org>
 
        sys_wait-h: Fix compilation error on Solaris 10 in C++ mode.
index e4fa3fbaf25d44dd86a467349e2a2d6963dd90d1..9e140ca5e8331c0e444066bd4203849cb341b201 100644 (file)
 
 /* Mac OS X 10.3, FreeBSD < 8.0, OpenBSD < 5.1, Solaris 2.6, Android,
    OS/2 kLIBC declare pthread_sigmask in <pthread.h>, not in <signal.h>.
-   But avoid namespace pollution on glibc systems.*/
+   But avoid namespace pollution on glibc systems.  */
 #if (@GNULIB_PTHREAD_SIGMASK@ || defined GNULIB_POSIXCHECK) \
     && ((defined __APPLE__ && defined __MACH__) \
         || (defined __FreeBSD__ && __FreeBSD__ < 8) \
         || (defined __OpenBSD__ && OpenBSD < 201205) \
-        || defined __sun || defined __ANDROID__ \
+        || (defined __sun && !defined __cplusplus) \
+        || defined __ANDROID__ \
         || defined __KLIBC__) \
     && ! defined __GLIBC__
 # include <pthread.h>