Skip to content

Commit 55c717d

Browse files
Stop including signal.h on WASI
The header file itself is available in wasi-libc, but it's just a stub that doesn't actually do anything. And also including it requires a special macro definition (`_WASI_EMULATED_SIGNAL`) and it causes compilation errors without the macro.
1 parent ac83e89 commit 55c717d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/_TestingInternals/include/Includes.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@
2727
/// - Note: Avoid including headers that aren't actually used.
2828

2929
#include <errno.h>
30-
#if __has_include(<signal.h>)
30+
/// Guard against including `signal.h` on WASI. The `signal.h` header file
31+
/// itself is available in wasi-libc, but it's just a stub that doesn't actually
32+
/// do anything. And also including it requires a special macro definition
33+
/// (`_WASI_EMULATED_SIGNAL`) and it causes compilation errors without the macro.
34+
#if __has_include(<signal.h>) && !defined(__wasi__)
3135
#include <signal.h>
3236
#endif
3337
#include <stdio.h>

0 commit comments

Comments
 (0)