X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fsignal.in.h;h=e0f0554bdbdfb1d96cad023464f18206f19919da;hb=72983fb6b5bd6c7de54465eea29464bb9c0276cf;hp=01987a7aff15fbb70e0da6ee7370f533f8795f88;hpb=cf74a3953bedd79cd53057aa00f1c90019c10102;p=gnulib.git diff --git a/lib/signal.in.h b/lib/signal.in.h index 01987a7af..e0f0554bd 100644 --- a/lib/signal.in.h +++ b/lib/signal.in.h @@ -1,6 +1,6 @@ /* A GNU-like . - Copyright (C) 2006-2011 Free Software Foundation, Inc. + Copyright (C) 2006-2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,8 +20,17 @@ #endif @PRAGMA_COLUMNS@ -#if defined __need_sig_atomic_t || defined __need_sigset_t -/* Special invocation convention inside glibc header files. */ +#if defined __need_sig_atomic_t || defined __need_sigset_t || defined _GL_ALREADY_INCLUDING_SIGNAL_H || (defined _SIGNAL_H && !defined __SIZEOF_PTHREAD_MUTEX_T) +/* Special invocation convention: + - Inside glibc header files. + - On glibc systems we have a sequence of nested includes + -> -> . + In this situation, the functions are not yet declared, therefore we cannot + provide the C++ aliases. + - On glibc systems with GCC 4.3 we have a sequence of nested includes + -> -> -> . + In this situation, some of the functions are not yet declared, therefore + we cannot provide the C++ aliases. */ # @INCLUDE_NEXT@ @NEXT_SIGNAL_H@ @@ -30,6 +39,8 @@ #ifndef _@GUARD_PREFIX@_SIGNAL_H +#define _GL_ALREADY_INCLUDING_SIGNAL_H + /* Define pid_t, uid_t. Also, mingw defines sigset_t not in , but in . On Solaris 10, includes , which eventually includes @@ -39,9 +50,20 @@ /* The include_next requires a split double-inclusion guard. */ #@INCLUDE_NEXT@ @NEXT_SIGNAL_H@ +#undef _GL_ALREADY_INCLUDING_SIGNAL_H + #ifndef _@GUARD_PREFIX@_SIGNAL_H #define _@GUARD_PREFIX@_SIGNAL_H +/* MacOS X 10.3, FreeBSD 6.4, OpenBSD 3.8, OSF/1 4.0, Solaris 2.6 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 __GLIBC__ +# include +#endif + /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ /* The definition of _GL_ARG_NONNULL is copied here. */ @@ -104,9 +126,23 @@ typedef void (*sighandler_t) (int); #if @GNULIB_PTHREAD_SIGMASK@ # if @REPLACE_PTHREAD_SIGMASK@ -# undef pthread_sigmask -# define pthread_sigmask sigprocmask +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_sigmask +# define pthread_sigmask rpl_pthread_sigmask +# endif +_GL_FUNCDECL_RPL (pthread_sigmask, int, + (int how, const sigset_t *new_mask, sigset_t *old_mask)); +_GL_CXXALIAS_RPL (pthread_sigmask, int, + (int how, const sigset_t *new_mask, sigset_t *old_mask)); +# else +# if !@HAVE_PTHREAD_SIGMASK@ +_GL_FUNCDECL_SYS (pthread_sigmask, int, + (int how, const sigset_t *new_mask, sigset_t *old_mask)); +# endif +_GL_CXXALIAS_SYS (pthread_sigmask, int, + (int how, const sigset_t *new_mask, sigset_t *old_mask)); # endif +_GL_CXXALIASWARN (pthread_sigmask); #elif defined GNULIB_POSIXCHECK # undef pthread_sigmask # if HAVE_RAW_DECL_PTHREAD_SIGMASK @@ -116,9 +152,36 @@ _GL_WARN_ON_USE (pthread_sigmask, "pthread_sigmask is not portable - " #endif +#if @GNULIB_RAISE@ +# if @REPLACE_RAISE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef raise +# define raise rpl_raise +# endif +_GL_FUNCDECL_RPL (raise, int, (int sig)); +_GL_CXXALIAS_RPL (raise, int, (int sig)); +# else +# if !@HAVE_RAISE@ +_GL_FUNCDECL_SYS (raise, int, (int sig)); +# endif +_GL_CXXALIAS_SYS (raise, int, (int sig)); +# endif +_GL_CXXALIASWARN (raise); +#elif defined GNULIB_POSIXCHECK +# undef raise +/* Assume raise is always declared. */ +_GL_WARN_ON_USE (raise, "raise can crash on native Windows - " + "use gnulib module raise for portability"); +#endif + + #if @GNULIB_SIGPROCMASK@ # if !@HAVE_POSIX_SIGNALBLOCKING@ +# ifndef GNULIB_defined_signal_blocking +# define GNULIB_defined_signal_blocking 1 +# endif + /* Maximum signal number + 1. */ # ifndef NSIG # define NSIG 32 @@ -244,18 +307,10 @@ _GL_CXXALIAS_SYS (signal, _gl_function_taking_int_returning_void_t, # endif _GL_CXXALIASWARN (signal); -/* Raise signal SIG. */ # if !@HAVE_POSIX_SIGNALBLOCKING@ && GNULIB_defined_SIGPIPE -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef raise -# define raise rpl_raise -# endif -_GL_FUNCDECL_RPL (raise, int, (int sig)); -_GL_CXXALIAS_RPL (raise, int, (int sig)); -# else -_GL_CXXALIAS_SYS (raise, int, (int sig)); +/* Raise signal SIGPIPE. */ +_GL_EXTERN_C int _gl_raise_SIGPIPE (void); # endif -_GL_CXXALIASWARN (raise); #elif defined GNULIB_POSIXCHECK # undef sigaddset