# HG changeset patch # User Paul Eggert # Date 1309938144 25200 # Node ID f61aaaf49e434499200d8ae8a6698f4863d837df # Parent b3eeae7bf93efb0d85101b3c5a6d10262e78ba6a sys_select: define sigset_t more portably * lib/sys_select.in.h: Always include , since we now need sigset_t and mingw defines it there. Include before split inclusion guard, to avoid mishaps on Solaris, whose eventually includes us. * m4/signal_h.m4 (gl_SIGNAL_H): Require gl_CHECK_TYPE_SIGSET_T. (gl_CHECK_TYPE_SIGSET_T): New macro, most of the contents of which come from ... * m4/signalblocking.m4 (gl_SIGNALBLOCKING): Require gl_CHECK_TYPE_SIGSET_T. (gl_PREREQ_SIGPROCMASK): Now a no-op, since gl_CHECK_TYPE_SIGSET_T does the real work. * modules/sys_select (Depends-on): Add 'signal'. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,19 @@ 2011-07-06 Paul Eggert + sys_select: define sigset_t more portably + * lib/sys_select.in.h: Always include , since + we now need sigset_t and mingw defines it there. + Include before split inclusion guard, to avoid + mishaps on Solaris, whose eventually includes us. + * m4/signal_h.m4 (gl_SIGNAL_H): Require gl_CHECK_TYPE_SIGSET_T. + (gl_CHECK_TYPE_SIGSET_T): New macro, most of the contents of + which come from ... + * m4/signalblocking.m4 (gl_SIGNALBLOCKING): Require + gl_CHECK_TYPE_SIGSET_T. + (gl_PREREQ_SIGPROCMASK): Now a no-op, since gl_CHECK_TYPE_SIGSET_T + does the real work. + * modules/sys_select (Depends-on): Add 'signal'. + * m4/sys_select_h.m4 (gl_HEADER_SYS_SELECT): Poison pselect. Suggested by Bruno Haible. diff --git a/lib/sys_select.in.h b/lib/sys_select.in.h --- a/lib/sys_select.in.h +++ b/lib/sys_select.in.h @@ -36,11 +36,18 @@ #ifndef _@GUARD_PREFIX@_SYS_SELECT_H -#if @HAVE_SYS_SELECT_H@ +/* On many platforms, assumes prior inclusion of + . Also, mingw defines sigset_t there, instead of + in where it belongs. */ +#include -/* On many platforms, assumes prior inclusion of - . */ -# include +/* Get definition of 'sigset_t'. + But avoid namespace pollution on glibc systems. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +#endif + +#if @HAVE_SYS_SELECT_H@ /* On OSF/1 4.0, provides only a forward declaration of 'struct timeval', and no definition of this type. @@ -85,12 +92,6 @@ # endif #endif -/* Get definition of 'sigset_t'. - But avoid namespace pollution on glibc systems. */ -#if !(defined __GLIBC__ && !defined __UCLIBC__) -# include -#endif - /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ /* The definition of _GL_WARN_ON_USE is copied here. */ diff --git a/m4/signal_h.m4 b/m4/signal_h.m4 --- a/m4/signal_h.m4 +++ b/m4/signal_h.m4 @@ -1,4 +1,4 @@ -# signal_h.m4 serial 13 +# signal_h.m4 serial 14 dnl Copyright (C) 2007-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -7,6 +7,7 @@ AC_DEFUN([gl_SIGNAL_H], [ AC_REQUIRE([gl_SIGNAL_H_DEFAULTS]) + AC_REQUIRE([gl_CHECK_TYPE_SIGSET_T]) gl_NEXT_HEADERS([signal.h]) # AIX declares sig_atomic_t to already include volatile, and C89 compilers @@ -32,6 +33,20 @@ sigpending sigprocmask]) ]) +AC_DEFUN([gl_CHECK_TYPE_SIGSET_T], +[ + AC_CHECK_TYPES([sigset_t], + [gl_cv_type_sigset_t=yes], [gl_cv_type_sigset_t=no], + [[ + #include + /* Mingw defines sigset_t not in , but in . */ + #include + ]]) + if test $gl_cv_type_sigset_t != yes; then + HAVE_SIGSET_T=0 + fi +]) + AC_DEFUN([gl_SIGNAL_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. diff --git a/m4/signalblocking.m4 b/m4/signalblocking.m4 --- a/m4/signalblocking.m4 +++ b/m4/signalblocking.m4 @@ -1,4 +1,4 @@ -# signalblocking.m4 serial 11 +# signalblocking.m4 serial 12 dnl Copyright (C) 2001-2002, 2006-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -12,9 +12,8 @@ AC_DEFUN([gl_SIGNALBLOCKING], [ AC_REQUIRE([gl_SIGNAL_H_DEFAULTS]) - signals_not_posix= - AC_EGREP_HEADER([sigset_t], [signal.h], , [signals_not_posix=1]) - if test -z "$signals_not_posix"; then + AC_REQUIRE([gl_CHECK_TYPE_SIGSET_T]) + if test $gl_cv_type_sigset_t = yes; then AC_CHECK_FUNC([sigprocmask], [gl_cv_func_sigprocmask=1]) fi if test -z "$gl_cv_func_sigprocmask"; then @@ -22,19 +21,5 @@ fi ]) -# Prerequisites of the part of lib/signal.in.h and of lib/sigprocmask.c. -AC_DEFUN([gl_PREREQ_SIGPROCMASK], -[ - AC_REQUIRE([gl_SIGNAL_H_DEFAULTS]) - AC_CHECK_TYPES([sigset_t], - [gl_cv_type_sigset_t=yes], [gl_cv_type_sigset_t=no], - [#include -/* Mingw defines sigset_t not in , but in . */ -#include ]) - if test $gl_cv_type_sigset_t != yes; then - HAVE_SIGSET_T=0 - fi - dnl HAVE_SIGSET_T is 1 if the system lacks the sigprocmask function but has - dnl the sigset_t type. - AC_SUBST([HAVE_SIGSET_T]) -]) +# Prerequisites of lib/sigprocmask.c. +AC_DEFUN([gl_PREREQ_SIGPROCMASK], [:]) diff --git a/modules/sys_select b/modules/sys_select --- a/modules/sys_select +++ b/modules/sys_select @@ -9,6 +9,7 @@ Depends-on: include_next c++defs +signal sys_time warn-on-use