guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 07/12: Add `scm_sigaction_for_thread' stub for MinGW.


From: Jan Nieuwenhuizen
Subject: [Guile-commits] 07/12: Add `scm_sigaction_for_thread' stub for MinGW.
Date: Mon, 12 Apr 2021 15:43:46 -0400 (EDT)

janneke pushed a commit to branch wip-mingw
in repository guile.

commit 9e14b8fcf74e604410cc4f33fe1a85df63354b4c
Author: Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
AuthorDate: Sat Mar 21 13:06:56 2020 +0100

    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 | 25 +++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/libguile/posix.c b/libguile/posix.c
index eaf12de..89ad0e5 100644
--- a/libguile/posix.c
+++ b/libguile/posix.c
@@ -61,7 +61,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 6359d2c..a50c684 100644
--- a/libguile/scmsigs.c
+++ b/libguile/scmsigs.c
@@ -320,6 +320,29 @@ scm_sigaction (SCM signum, SCM handler, SCM flags)
   return scm_sigaction_for_thread (signum, handler, flags, SCM_UNDEFINED);
 }
 
+#if __MINGW32__
+
+int _mingw_debug_p ();
+
+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
+{
+  static int stub = 0;
+  (void) signum;
+  (void) handler;
+  (void) flags;
+  (void) thread;
+  if (_mingw_debug_p () && !stub)
+    fputs ("stub: sigaction", stderr);
+  stub = 1;
+  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),
@@ -515,6 +538,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"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]