From: Bruno Haible Date: Sun, 18 Sep 2022 12:41:20 +0000 (+0200) Subject: signal: Fix a C++ compilation error due to sched_yield on OpenBSD 6.0. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=a945847ddc036d188e23a3e6cde7ba5364c628bf;p=gnulib.git signal: Fix a C++ compilation error due to sched_yield on OpenBSD 6.0. * lib/signal.in.h: On OpenBSD, include . Don't include on OpenBSD ≥ 5.1. --- diff --git a/ChangeLog b/ChangeLog index 52106a4765..a3cd50b84f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2022-09-18 Bruno Haible + + signal: Fix a C++ compilation error due to sched_yield on OpenBSD 6.0. + * lib/signal.in.h: On OpenBSD, include . Don't include + on OpenBSD ≥ 5.1. + 2022-09-17 Bruno Haible wchar: Fix compilation errors in C++ mode on Solaris 11.3. diff --git a/lib/signal.in.h b/lib/signal.in.h index 5d2d80c99d..c0d4848db0 100644 --- a/lib/signal.in.h +++ b/lib/signal.in.h @@ -55,12 +55,19 @@ #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 +#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 , not in . 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__