From: Eli Zaretskii Date: Mon, 30 May 2022 17:51:19 +0000 (+0300) Subject: Fix 'debug-timer-check' on MS-Windows X-Git-Tag: emacs-29.0.90~1910^2~328 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c9e5e79ac21c0593678a1a75b58bcb5b9e0dbcc3;p=emacs.git Fix 'debug-timer-check' on MS-Windows * src/w32proc.c (w32_raise): New function. * src/atimer.c (raise) [WINDOWSNT]: Redirect to 'w32_raise'. --- diff --git a/src/atimer.c b/src/atimer.c index c26904e1f01..18301120ffe 100644 --- a/src/atimer.c +++ b/src/atimer.c @@ -18,6 +18,10 @@ along with GNU Emacs. If not, see . */ #include +#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 781a19f480f..7acfba64d70 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -63,6 +63,8 @@ along with GNU Emacs. If not, see . */ #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) {