[前][次][番号順一覧][スレッド一覧]

ruby-changes:64112

From: Nobuyoshi <ko1@a...>
Date: Sat, 12 Dec 2020 17:03:05 +0900 (JST)
Subject: [ruby-changes:64112] 0df67a4695 (master): Signal handler type should be void

https://git.ruby-lang.org/ruby.git/commit/?id=0df67a4695

From 0df67a469561fab80b78478b99703ed893c4db07 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sat, 12 Dec 2020 16:06:19 +0900
Subject: Signal handler type should be void


diff --git a/configure.ac b/configure.ac
index 65494b4..1e03104 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1743,7 +1743,6 @@ AS_IF([test $rb_cv_stack_end_address != no], [ https://github.com/ruby/ruby/blob/trunk/configure.ac#L1743
 
 dnl Checks for library functions.
 AC_TYPE_GETGROUPS
-AC_TYPE_SIGNAL
 AS_CASE(["${target_cpu}-${target_os}:${target_archs}"],
 [powerpc-darwin*], [
   AC_LIBSOURCES(alloca.c)
diff --git a/include/ruby/internal/intern/signal.h b/include/ruby/internal/intern/signal.h
index b6171d1..8739c51 100644
--- a/include/ruby/internal/intern/signal.h
+++ b/include/ruby/internal/intern/signal.h
@@ -20,7 +20,6 @@ https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/intern/signal.h#L20
  *             extension libraries. They could be written in C++98.
  * @brief      Signal handling APIs.
  */
-#include "ruby/internal/config.h"      /* POSIX_SIGNAL / RETSIGTYPE */
 #include "ruby/internal/dllexport.h"
 #include "ruby/internal/value.h"
 
@@ -30,7 +29,7 @@ RBIMPL_SYMBOL_EXPORT_BEGIN() https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/intern/signal.h#L29
 VALUE rb_f_kill(int, const VALUE*);
 #ifdef POSIX_SIGNAL
 #define posix_signal ruby_posix_signal
-RETSIGTYPE (*posix_signal(int, RETSIGTYPE (*)(int)))(int);
+void (*posix_signal(int, void (*)(int)))(int);
 #endif
 const char *ruby_signal_name(int);
 void ruby_default_signal(int);
diff --git a/signal.c b/signal.c
index 91521fe..6eea6aa 100644
--- a/signal.c
+++ b/signal.c
@@ -415,7 +415,7 @@ ruby_default_signal(int sig) https://github.com/ruby/ruby/blob/trunk/signal.c#L415
     raise(sig);
 }
 
-static RETSIGTYPE sighandler(int sig);
+static void sighandler(int sig);
 static int signal_ignored(int sig);
 static void signal_enque(int sig);
 
@@ -519,7 +519,7 @@ typedef void ruby_sigaction_t(int, siginfo_t*, void*); https://github.com/ruby/ruby/blob/trunk/signal.c#L519
 #define SIGINFO_ARG , siginfo_t *info, void *ctx
 #define SIGINFO_CTX ctx
 #else
-typedef RETSIGTYPE ruby_sigaction_t(int);
+typedef void ruby_sigaction_t(int);
 #define SIGINFO_ARG
 #define SIGINFO_CTX 0
 #endif
@@ -712,7 +712,7 @@ static rb_atomic_t sigchld_hit; https://github.com/ruby/ruby/blob/trunk/signal.c#L712
 # define GET_SIGCHLD_HIT() 0
 #endif
 
-static RETSIGTYPE
+static void
 sighandler(int sig)
 {
     int old_errnum = errno;
@@ -930,7 +930,7 @@ NOINLINE(static void check_reserved_signal_(const char *name, size_t name_len)); https://github.com/ruby/ruby/blob/trunk/signal.c#L930
 static sighandler_t default_sigbus_handler;
 NORETURN(static ruby_sigaction_t sigbus);
 
-static RETSIGTYPE
+static void
 sigbus(int sig SIGINFO_ARG)
 {
     check_reserved_signal("BUS");
@@ -952,7 +952,7 @@ sigbus(int sig SIGINFO_ARG) https://github.com/ruby/ruby/blob/trunk/signal.c#L952
 static sighandler_t default_sigsegv_handler;
 NORETURN(static ruby_sigaction_t sigsegv);
 
-static RETSIGTYPE
+static void
 sigsegv(int sig SIGINFO_ARG)
 {
     check_reserved_signal("SEGV");
@@ -966,7 +966,7 @@ sigsegv(int sig SIGINFO_ARG) https://github.com/ruby/ruby/blob/trunk/signal.c#L966
 static sighandler_t default_sigill_handler;
 NORETURN(static ruby_sigaction_t sigill);
 
-static RETSIGTYPE
+static void
 sigill(int sig SIGINFO_ARG)
 {
     check_reserved_signal("ILL");
@@ -1031,7 +1031,7 @@ check_reserved_signal_(const char *name, size_t name_len) https://github.com/ruby/ruby/blob/trunk/signal.c#L1031
 #endif
 
 #if defined SIGPIPE || defined SIGSYS
-static RETSIGTYPE
+static void
 sig_do_nothing(int sig)
 {
 }
diff --git a/vm_core.h b/vm_core.h
index f451723..a4c0e87 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -1631,7 +1631,7 @@ extern void rb_vmdebug_debug_print_post(const rb_execution_context_t *ec, const https://github.com/ruby/ruby/blob/trunk/vm_core.h#L1631
 #define SDR() rb_vmdebug_stack_dump_raw(GET_EC(), GET_EC()->cfp)
 #define SDR2(cfp) rb_vmdebug_stack_dump_raw(GET_EC(), (cfp))
 void rb_vm_bugreport(const void *);
-typedef RETSIGTYPE (*ruby_sighandler_t)(int);
+typedef void (*ruby_sighandler_t)(int);
 NORETURN(void rb_bug_for_fatal_signal(ruby_sighandler_t default_sighandler, int sig, const void *, const char *fmt, ...));
 
 /* functions about thread/vm execution */
diff --git a/win32/Makefile.sub b/win32/Makefile.sub
index 71565f0..85c6e9a 100644
--- a/win32/Makefile.sub
+++ b/win32/Makefile.sub
@@ -783,7 +783,6 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L783
 #define PRI_LL_PREFIX "I64"
 #define PRI_PIDT_PREFIX PRI_INT_PREFIX
 #define GETGROUPS_T int
-#define RETSIGTYPE void
 #define TYPEOF_TIMEVAL_TV_SEC long
 !if $(RT_VER) >= 120
 #define HAVE_ACOSH 1
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]