From 2b86a3b1cbc478ff427ed67098164a1ca65a71bf Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Sat, 21 Mar 2020 13:06:56 +0100 Subject: [PATCH] Add `scm_sigaction_for_thread' stub for MinGW. * libguile/scmsigs.c (scm_sigaction_for_thread)[__MINGW32__]: New stub. (SIGHUP, SIGPIPE)[__MINGW32__]: New defines. --- libguile/posix.c | 4 +++- libguile/scmsigs.c | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/libguile/posix.c b/libguile/posix.c index c8bbb0f83..74263a4d5 100644 --- a/libguile/posix.c +++ b/libguile/posix.c @@ -54,7 +54,9 @@ #ifdef __MINGW32__ # include "posix-w32.h" -#endif +# define SIGHUP 1 +# define SIGPIPE 13 +#endif /* __MINGW32__ */ #include "async.h" #include "bitvectors.h" diff --git a/libguile/scmsigs.c b/libguile/scmsigs.c index 3cf97c1f0..d63c7a2b3 100644 --- a/libguile/scmsigs.c +++ b/libguile/scmsigs.c @@ -419,6 +419,23 @@ scm_sigaction (SCM signum, SCM handler, SCM flags) return scm_sigaction_for_thread (signum, handler, flags, SCM_UNDEFINED); } +#if __MINGW32__ + +SCM_DEFINE (scm_sigaction_for_thread, "sigaction", 1, 3, 0, + (SCM signum, SCM handler, SCM flags, SCM thread), + "sigaction stub") +#define FUNC_NAME s_scm_sigaction_for_thread +{ + (void) signum; + (void) handler; + (void) flags; + (void) thread; + return SCM_UNSPECIFIED; +} +#undef FUNC_NAME + +#else /* !__MINGW32__ */ + /* user interface for installation of signal handlers. */ SCM_DEFINE (scm_sigaction_for_thread, "sigaction", 1, 3, 0, (SCM signum, SCM handler, SCM flags, SCM thread), @@ -618,6 +635,8 @@ SCM_DEFINE (scm_sigaction_for_thread, "sigaction", 1, 3, 0, } #undef FUNC_NAME +#endif /* !__MINGW32__ */ + SCM_DEFINE (scm_restore_signals, "restore-signals", 0, 0, 0, (void), "Return all signal handlers to the values they had before any call to\n"