ruby-changes:8838
From: nobu <ko1@a...>
Date: Thu, 27 Nov 2008 16:12:44 +0900 (JST)
Subject: [ruby-changes:8838] Ruby:r20374 (trunk): * signal.c (ruby_sigaction_t): added.
nobu 2008-11-27 16:12:35 +0900 (Thu, 27 Nov 2008) New Revision: 20374 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20374 Log: * signal.c (ruby_sigaction_t): added. Modified files: trunk/signal.c Index: signal.c =================================================================== --- signal.c (revision 20373) +++ signal.c (revision 20374) @@ -408,6 +408,13 @@ #endif typedef RETSIGTYPE (*sighandler_t)(int); +#ifdef SA_SIGINFO +typedef void ruby_sigaction_t(int, siginfo_t*, void*); +#define SIGINFO_ARG , siginfo_t *info, void *ctx +#else +typedef RETSIGTYPE ruby_sigaction_t(int); +#define SIGINFO_ARG +#endif #ifdef POSIX_SIGNAL #if defined(SIGSEGV) && defined(HAVE_SIGALTSTACK) @@ -415,7 +422,6 @@ #endif #ifdef USE_SIGALTSTACK -#define SIGINFO_ARG , siginfo_t *info, void *ctx #ifdef SIGSTKSZ #define ALT_STACK_SIZE (SIGSTKSZ*2) #else @@ -442,8 +448,6 @@ rb_bug("register_sigaltstack. error\n"); is_altstack_defined = 1; } -#else -#define SIGINFO_ARG #endif static sighandler_t @@ -457,7 +461,7 @@ sigemptyset(&sigact.sa_mask); #ifdef SA_SIGINFO - sigact.sa_sigaction = (void (*)(int, siginfo_t*, void*))handler; + sigact.sa_sigaction = (ruby_sigaction_t*)handler; sigact.sa_flags = SA_SIGINFO; #else sigact.sa_handler = handler; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/