From 6000b1ff03db2cd237706b5f0511a5323434090b Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 3 Sep 2022 22:40:05 +0200 Subject: [PATCH] Fix a compilation error in C++ mode on FreeBSD 13.1. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * lib/signal.in.h: Don't include on FreeBSD ≥ 8.0. * lib/sys_select.in.h: Don't include on FreeBSD. --- ChangeLog | 6 ++++++ lib/signal.in.h | 7 ++++--- lib/sys_select.in.h | 7 ++++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 14ad58968f..569b4cc058 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2022-09-03 Bruno Haible + + Fix a compilation error in C++ mode on FreeBSD 13.1. + * lib/signal.in.h: Don't include on FreeBSD ≥ 8.0. + * lib/sys_select.in.h: Don't include on FreeBSD. + 2022-09-02 Bruno Haible getrandom: Fix compilation error in C++ mode on FreeBSD 12. diff --git a/lib/signal.in.h b/lib/signal.in.h index 640b5022f5..5d2d80c99d 100644 --- a/lib/signal.in.h +++ b/lib/signal.in.h @@ -55,13 +55,14 @@ #ifndef _@GUARD_PREFIX@_SIGNAL_H #define _@GUARD_PREFIX@_SIGNAL_H -/* Mac OS X 10.3, FreeBSD 6.4, OpenBSD 3.8, OSF/1 4.0, Solaris 2.6, Android, +/* Mac OS X 10.3, FreeBSD < 8.0, OpenBSD 3.8, 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__ || defined __OpenBSD__ || defined __osf__ \ - || defined __sun || defined __ANDROID__ || defined __KLIBC__) \ + || (defined __FreeBSD__ && __FreeBSD__ < 8) || defined __OpenBSD__ \ + || defined __osf__ || defined __sun || defined __ANDROID__ \ + || defined __KLIBC__) \ && ! defined __GLIBC__ # include #endif diff --git a/lib/sys_select.in.h b/lib/sys_select.in.h index 2bd0e0f79a..b424f1b803 100644 --- a/lib/sys_select.in.h +++ b/lib/sys_select.in.h @@ -82,9 +82,10 @@ of 'struct timeval', and no definition of this type. Also, Mac OS X, AIX, HP-UX, IRIX, Solaris, Interix declare select() in . - But avoid namespace pollution on glibc systems and "unknown type - name" problems on Cygwin. */ -# if !(defined __GLIBC__ || defined __CYGWIN__) + But avoid namespace pollution on glibc systems, a circular include + -> -> on FreeBSD 13.1, and + "unknown type name" problems on Cygwin. */ +# if !(defined __GLIBC__ || defined __FreeBSD__ || defined __CYGWIN__) # include # endif -- 2.39.5