]> Savannah Git Hosting - gnulib.git/commitdiff
signal: Fix a C++ compilation error due to sched_yield on OpenBSD 6.0.
authorBruno Haible <bruno@clisp.org>
Sun, 18 Sep 2022 12:41:20 +0000 (14:41 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 18 Sep 2022 19:23:14 +0000 (21:23 +0200)
* lib/signal.in.h: On OpenBSD, include <sys/param.h>. Don't include
<pthread.h> on OpenBSD ≥ 5.1.

ChangeLog
lib/signal.in.h

index 52106a47655281d2301d02b450de3bb63b4f7bc6..a3cd50b84f5b19edcec3b5300adc13926e1cdb21 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2022-09-18  Bruno Haible  <bruno@clisp.org>
+
+       signal: Fix a C++ compilation error due to sched_yield on OpenBSD 6.0.
+       * lib/signal.in.h: On OpenBSD, include <sys/param.h>. Don't include
+       <pthread.h> on OpenBSD ≥ 5.1.
+
 2022-09-17  Bruno Haible  <bruno@clisp.org>
 
        wchar: Fix compilation errors in C++ mode on Solaris 11.3.
index 5d2d80c99ddc04fc731d99e08e285484e63faa11..c0d4848db0a9ec5159d390729989aa625d3d78a5 100644 (file)
 #ifndef _@GUARD_PREFIX@_SIGNAL_H
 #define _@GUARD_PREFIX@_SIGNAL_H
 
-/* Mac OS X 10.3, FreeBSD < 8.0, OpenBSD 3.8, OSF/1 4.0, Solaris 2.6, Android,
+/* For testing the OpenBSD version.  */
+#if (@GNULIB_PTHREAD_SIGMASK@ || defined GNULIB_POSIXCHECK) \
+    && defined __OpenBSD__
+# include <sys/param.h>
+#endif
+
+/* Mac OS X 10.3, FreeBSD < 8.0, OpenBSD < 5.1, OSF/1 4.0, Solaris 2.6, Android,
    OS/2 kLIBC declare pthread_sigmask in <pthread.h>, not in <signal.h>.
    But avoid namespace pollution on glibc systems.*/
 #if (@GNULIB_PTHREAD_SIGMASK@ || defined GNULIB_POSIXCHECK) \
     && ((defined __APPLE__ && defined __MACH__) \
-        || (defined __FreeBSD__ && __FreeBSD__ < 8) || defined __OpenBSD__ \
+        || (defined __FreeBSD__ && __FreeBSD__ < 8) \
+        || (defined __OpenBSD__ && OpenBSD < 201205) \
         || defined __osf__ || defined __sun || defined __ANDROID__ \
         || defined __KLIBC__) \
     && ! defined __GLIBC__