ports/unix/unix_mphal.c: Disable signal mask stuff for WASI.

WASI dosen't have signals.

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
YAMAMOTO Takashi 2024-02-13 16:35:28 +09:00
rodzic c8abdd153e
commit 97eb64546a
1 zmienionych plików z 9 dodań i 3 usunięć

Wyświetl plik

@ -43,7 +43,13 @@
#endif
#endif
#ifndef _WIN32
#if defined(_WIN32) || defined(__wasi__)
#define HAS_SIGNAL 0
#else
#define HAS_SIGNAL 1
#endif
#if HAS_SIGNAL != 0
#include <signal.h>
STATIC void sighandler(int signum) {
@ -75,7 +81,7 @@ STATIC void sighandler(int signum) {
void mp_hal_set_interrupt_char(char c) {
// configure terminal settings to (not) let ctrl-C through
if (c == CHAR_CTRL_C) {
#ifndef _WIN32
#if HAS_SIGNAL != 0
// enable signal handler
struct sigaction sa;
sa.sa_flags = 0;
@ -84,7 +90,7 @@ void mp_hal_set_interrupt_char(char c) {
sigaction(SIGINT, &sa, NULL);
#endif
} else {
#ifndef _WIN32
#if HAS_SIGNAL != 0
// disable signal handler
struct sigaction sa;
sa.sa_flags = 0;