[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 11/13: Presumes signal handler return void
From: |
Mike Gran |
Subject: |
[Guile-commits] 11/13: Presumes signal handler return void |
Date: |
Sat, 8 Oct 2022 11:26:51 -0400 (EDT) |
mike121 pushed a commit to branch wip-modernize-autotools
in repository guile.
commit c0feb578fb11d6af2832152fa3098c66053a032f
Author: Michael Gran <spk121@yahoo.com>
AuthorDate: Sat Oct 8 05:47:00 2022 -0700
Presumes signal handler return void
Since Guile requires a C99 compiler, we can rely on signal handlers
returning void, not int.
* configure.ac: remove AC_TYPE_SIGNAL
* libguile/scmsigs.c (SIGRETTYPE): remove SIGRETTYPE
(take_signal): returns void
(scm_sigaction_for_thread): presumes handlers return void
---
configure.ac | 1 -
libguile/scmsigs.c | 24 +++++++-----------------
2 files changed, 7 insertions(+), 18 deletions(-)
diff --git a/configure.ac b/configure.ac
index d93c70b24..52a844fe8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -444,7 +444,6 @@ AC_CHECK_TYPE(socklen_t, ,
AC_CHECK_TYPES([struct ip_mreq], , , [#include <netinet/in.h>])
AC_TYPE_GETGROUPS
-AC_TYPE_SIGNAL
AC_TYPE_MODE_T
dnl Check whether we need -lm.
diff --git a/libguile/scmsigs.c b/libguile/scmsigs.c
index 5b8ffaf80..975d2bd18 100644
--- a/libguile/scmsigs.c
+++ b/libguile/scmsigs.c
@@ -62,16 +62,6 @@
-/* SIGRETTYPE is the type that signal handlers return. See <signal.h> */
-
-#ifdef RETSIGTYPE
-# define SIGRETTYPE RETSIGTYPE
-#else
-# define SIGRETTYPE void
-#endif
-
-
-
/* take_signal is installed as the C signal handler whenever a Scheme
handler is set. When a signal arrives, take_signal will write a
byte into the 'signal pipe'. The 'signal delivery thread' will
@@ -108,7 +98,7 @@ static scm_i_pthread_mutex_t signal_delivery_thread_mutex =
#ifdef HAVE_SIGACTION
static struct sigaction orig_handlers[NSIG];
#else
-static SIGRETTYPE (*orig_handlers[NSIG])(int);
+static void (*orig_handlers[NSIG])(int);
#endif
static SCM
@@ -130,7 +120,7 @@ close_1 (SCM proc, SCM arg)
static int signal_pipe[2];
-static SIGRETTYPE
+static void
take_signal (int signum)
{
int old_errno = errno;
@@ -235,7 +225,7 @@ scm_i_ensure_signal_delivery_thread ()
#else /* !SCM_USE_PTHREAD_THREADS */
-static SIGRETTYPE
+static void
take_signal (int signum)
{
SCM cell = SCM_SIMPLE_VECTOR_REF (signal_handler_asyncs, signum);
@@ -321,8 +311,8 @@ SCM_DEFINE (scm_sigaction_for_thread, "sigaction", 1, 3, 0,
struct sigaction action;
struct sigaction old_action;
#else
- SIGRETTYPE (* chandler) (int) = SIG_DFL;
- SIGRETTYPE (* old_chandler) (int);
+ void (* chandler) (int) = SIG_DFL;
+ void (* old_chandler) (int);
#endif
int query_only = 0;
int save_handler = 0;
@@ -359,9 +349,9 @@ SCM_DEFINE (scm_sigaction_for_thread, "sigaction", 1, 3, 0,
if (handler_int == (long) SIG_DFL || handler_int == (long) SIG_IGN)
{
#ifdef HAVE_SIGACTION
- action.sa_handler = (SIGRETTYPE (*) (int)) handler_int;
+ action.sa_handler = (void (*) (int)) handler_int;
#else
- chandler = (SIGRETTYPE (*) (int)) handler_int;
+ chandler = (void (*) (int)) handler_int;
#endif
install_handler (csig, SCM_BOOL_F, SCM_BOOL_F);
}
- [Guile-commits] branch wip-modernize-autotools updated (eb9e547e6 -> 0bebd7a32), Mike Gran, 2022/10/08
- [Guile-commits] 08/13: Presume time.h and sys/time.h don't conflict when included, Mike Gran, 2022/10/08
- [Guile-commits] 10/13: Modernizes labels-as-values.m4, Mike Gran, 2022/10/08
- [Guile-commits] 07/13: Presume ISO C90 functions are always available, Mike Gran, 2022/10/08
- [Guile-commits] 13/13: Adds automake option for subdirs, Mike Gran, 2022/10/08
- [Guile-commits] 01/13: Update libtool initialization in configure script, Mike Gran, 2022/10/08
- [Guile-commits] 04/13: Remove obsolete macro AM_PROG_CC_C_O in configure script, Mike Gran, 2022/10/08
- [Guile-commits] 05/13: Remove AC_HEADER_STDC from configure.ac, Mike Gran, 2022/10/08
- [Guile-commits] 06/13: Presume ISO C90 headers are always available, Mike Gran, 2022/10/08
- [Guile-commits] 09/13: Remove special logic for the obscure CMU C library's libc.h, Mike Gran, 2022/10/08
- [Guile-commits] 11/13: Presumes signal handler return void,
Mike Gran <=
- [Guile-commits] 12/13: autoupdate acinclude.m4, Mike Gran, 2022/10/08
- [Guile-commits] 03/13: Use autoconf's ability to choose the latest version of C, Mike Gran, 2022/10/08
- [Guile-commits] 02/13: Presume const is always available, Mike Gran, 2022/10/08