]> Savannah Git Hosting - gnulib.git/commitdiff
Fix "warning: implicit declaration of function 'pthread_sigmask'".
authorKO Myung-Hun <komh78@gmail.com>
Sun, 11 Oct 2020 11:30:32 +0000 (13:30 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 11 Oct 2020 11:30:32 +0000 (13:30 +0200)
* lib/signal.in.h [__KLIBC__]: Include <pthread.h>.
* lib/sys_select.in.h [__KLIBC__]: Do not include <signal.h>.

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

index 2aba2b0c7dd740dc7d4010709c63fedaa011f903..5789d74055e14f013ef5f595bf4ec49f7860a62c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2020-10-11  KO Myung-Hun  <komh78@gmail.com>
+
+       Fix "warning: implicit declaration of function 'pthread_sigmask'".
+       * lib/signal.in.h [__KLIBC__]: Include <pthread.h>.
+       * lib/sys_select.in.h [__KLIBC__]: Do not include <signal.h>.
+
 2020-10-10  Bruno Haible  <bruno@clisp.org>
 
        *-list, *-oset, *-omap: Avoid possible compiler warnings.
index c94b053d6af96734778e3f0bfd1a8dc274004e75..70a2d4af6ca552b5dfe72b41a72bbfef131e42bb 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
-   declare pthread_sigmask in <pthread.h>, not in <signal.h>.
+/* Mac OS X 10.3, FreeBSD 6.4, 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 __sun || defined __ANDROID__ || defined __KLIBC__) \
     && ! defined __GLIBC__
 # include <pthread.h>
 #endif
index d625d73e71dd543ab6f64a617403acfdb0fba1a9..034b0f32f0be5e05c4fa6ce579b1d80660f4d98b 100644 (file)
 /* Get definition of 'sigset_t'.
    But avoid namespace pollution on glibc systems and "unknown type
    name" problems on Cygwin.
+   On OS/2 kLIBC, sigset_t is defined in <sys/select.h>, too. In addition,
+   if <sys/param.h> is included, <types.h> -> <sys/types.h> -> <sys/select.h>
+   are included. Then <signal.h> -> <pthread.h> are included by GNULIB. By the
+   way, <pthread.h> requires PAGE_SIZE defined in <sys/param.h>. However,
+   <sys/param.h> has not been processed, yet. As a result, 'PAGE_SIZE'
+   undeclared error occurs in <pthread.h>.
    Do this after the include_next (for the sake of OpenBSD 5.0) but before
    the split double-inclusion guard (for the sake of Solaris).  */
-#if !((defined __GLIBC__ || defined __CYGWIN__) && !defined __UCLIBC__)
+#if !((defined __GLIBC__ || defined __CYGWIN__ || defined __KLIBC__) \
+      && !defined __UCLIBC__)
 # include <signal.h>
 #endif