emacs-diffs
[Top][All Lists]
Advanced

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

master c9e5e79ac2: Fix 'debug-timer-check' on MS-Windows


From: Eli Zaretskii
Subject: master c9e5e79ac2: Fix 'debug-timer-check' on MS-Windows
Date: Mon, 30 May 2022 13:52:19 -0400 (EDT)

branch: master
commit c9e5e79ac21c0593678a1a75b58bcb5b9e0dbcc3
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Fix 'debug-timer-check' on MS-Windows
    
    * src/w32proc.c (w32_raise): New function.
    * src/atimer.c (raise) [WINDOWSNT]: Redirect to 'w32_raise'.
---
 src/atimer.c  |  4 ++++
 src/w32proc.c | 17 +++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/src/atimer.c b/src/atimer.c
index c26904e1f0..18301120ff 100644
--- a/src/atimer.c
+++ b/src/atimer.c
@@ -18,6 +18,10 @@ along with GNU Emacs.  If not, see 
<https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
+#ifdef WINDOWSNT
+#define raise(s) w32_raise(s)
+#endif
+
 #include "lisp.h"
 #include "keyboard.h"
 #include "syssignal.h"
diff --git a/src/w32proc.c b/src/w32proc.c
index 781a19f480..7acfba64d7 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -63,6 +63,8 @@ along with GNU Emacs.  If not, see 
<https://www.gnu.org/licenses/>.  */
 #include "w32term.h"
 #include "coding.h"
 
+void w32_raise (int);
+
 #define RVA_TO_PTR(var,section,filedata) \
   ((void *)((section)->PointerToRawData                                        
\
            + ((DWORD_PTR)(var) - (section)->VirtualAddress)            \
@@ -311,6 +313,21 @@ sigismember (const sigset_t *set, int signo)
   return (*set & (1U << signo)) != 0;
 }
 
+/* A fuller emulation of 'raise', which supports signals that MS
+   runtime doesn't know about.  */
+void
+w32_raise (int signo)
+{
+  if (!(signo == SIGCHLD || signo == SIGALRM || signo == SIGPROF))
+    raise (signo);
+
+  /* Call the handler directly for the signals that we handle
+     ourselves.  */
+  signal_handler handler = sig_handlers[signo];
+  if (!(handler == SIG_DFL || handler == SIG_IGN || handler == SIG_ERR))
+    handler (signo);
+}
+
 pid_t
 getpgrp (void)
 {



reply via email to

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