]> Savannah Git Hosting - gnulib.git/commitdiff
Fix a compilation error in C++ mode on FreeBSD 13.1.
authorBruno Haible <bruno@clisp.org>
Sat, 3 Sep 2022 20:40:05 +0000 (22:40 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 4 Sep 2022 00:09:15 +0000 (02:09 +0200)
* lib/signal.in.h: Don't include <pthread.h> on FreeBSD ≥ 8.0.
* lib/sys_select.in.h: Don't include <sys/time.h> on FreeBSD.

ChangeLog
lib/signal.in.h
lib/sys_select.in.h

index 14ad58968f3b04014f6aff2f21826ae4f2d609d3..569b4cc0584c329b1c943ddd13c2379be85696dd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2022-09-03  Bruno Haible  <bruno@clisp.org>
+
+       Fix a compilation error in C++ mode on FreeBSD 13.1.
+       * lib/signal.in.h: Don't include <pthread.h> on FreeBSD ≥ 8.0.
+       * lib/sys_select.in.h: Don't include <sys/time.h> on FreeBSD.
+
 2022-09-02  Bruno Haible  <bruno@clisp.org>
 
        getrandom: Fix compilation error in C++ mode on FreeBSD 12.
index 640b5022f5f099b492543ec5a77d8b3ec32370fb..5d2d80c99ddc04fc731d99e08e285484e63faa11 100644 (file)
 #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 <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__ || 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 <pthread.h>
 #endif
index 2bd0e0f79a831350d76a66bd706e18b3973673c5..b424f1b8033ead6a69754e9ceb41ec05f0f113c1 100644 (file)
    of 'struct timeval', and no definition of this type.
    Also, Mac OS X, AIX, HP-UX, IRIX, Solaris, Interix declare select()
    in <sys/time.h>.
-   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
+   <sys/select.h> -> <sys/time.h> -> <sys/select.h> on FreeBSD 13.1, and
+   "unknown type name" problems on Cygwin.  */
+# if !(defined __GLIBC__ || defined __FreeBSD__ || defined __CYGWIN__)
 #  include <sys/time.h>
 # endif