# HG changeset patch # User Bruno Haible # Date 1538769204 -7200 # Node ID 38e070a924c213688abad28a1d0aedce8d0f3c46 # Parent 281300b4ad177942f9550f6ca12193bdb280af17 raise: Make it possible to namespace the defined symbol. * lib/raise.c (raise): Undefine only after the replacement function has been defined. (raise): Renamed from rpl_raise. (raise_nothrow): Move to the end of the compilation unit. diff -r 281300b4ad17 -r 38e070a924c2 ChangeLog --- a/ChangeLog Fri Oct 05 21:50:47 2018 +0200 +++ b/ChangeLog Fri Oct 05 21:53:24 2018 +0200 @@ -1,3 +1,11 @@ +2018-10-05 Bruno Haible + + raise: Make it possible to namespace the defined symbol. + * lib/raise.c (raise): Undefine only after the replacement function has + been defined. + (raise): Renamed from rpl_raise. + (raise_nothrow): Move to the end of the compilation unit. + 2018-10-05 Bruno Haible memcmp: Make it possible to namespace the defined symbol. diff -r 281300b4ad17 -r 38e070a924c2 lib/raise.c --- a/lib/raise.c Fri Oct 05 21:50:47 2018 +0200 +++ b/lib/raise.c Fri Oct 05 21:53:24 2018 +0200 @@ -31,9 +31,37 @@ # include "msvc-inval.h" # endif -# undef raise +# if HAVE_MSVC_INVALID_PARAMETER_HANDLER +/* Forward declaration. */ +static int raise_nothrow (int sig); +# else +# define raise_nothrow raise +# endif + +#else +/* An old Unix platform. */ + +# include + +#endif -# if HAVE_MSVC_INVALID_PARAMETER_HANDLER +int +raise (int sig) +#undef raise +{ +#if GNULIB_defined_signal_blocking && GNULIB_defined_SIGPIPE + if (sig == SIGPIPE) + return _gl_raise_SIGPIPE (); +#endif + +#if HAVE_RAISE + return raise_nothrow (sig); +#else + return kill (getpid (), sig); +#endif +} + +#if HAVE_RAISE && HAVE_MSVC_INVALID_PARAMETER_HANDLER static int raise_nothrow (int sig) { @@ -52,30 +80,4 @@ return result; } -# else -# define raise_nothrow raise -# endif - -#else -/* An old Unix platform. */ - -# include - -# define rpl_raise raise - #endif - -int -rpl_raise (int sig) -{ -#if GNULIB_defined_signal_blocking && GNULIB_defined_SIGPIPE - if (sig == SIGPIPE) - return _gl_raise_SIGPIPE (); -#endif - -#if HAVE_RAISE - return raise_nothrow (sig); -#else - return kill (getpid (), sig); -#endif -}