File tree 1 file changed +8
-4
lines changed
Sources/_FoundationCShims/include 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 60
60
#endif
61
61
62
62
#if __has_include (< signal .h > )
63
- /* wasi-libc's signal.h is available only if _WASI_EMULATED_SIGNAL is defined */
64
- # if !defined(__wasi__ ) || defined(_WASI_EMULATED_SIGNAL )
63
+ /// Guard against including `signal.h` on WASI. The `signal.h` header file
64
+ /// itself is available in wasi-libc, but it's just a stub that doesn't actually
65
+ /// do anything. And also including it requires a special macro definition
66
+ /// (`_WASI_EMULATED_SIGNAL`) and it causes compilation errors without the macro.
67
+ # if !TARGET_OS_WASI || defined(_WASI_EMULATED_SIGNAL )
65
68
# include <signal.h>
66
69
# endif
67
70
#endif
68
71
69
72
#if __has_include (< sys /mman .h > )
70
- /* wasi-libc's mman.h is available only if _WASI_EMULATED_MMAN is defined */
71
- # if !defined(__wasi__ ) || defined(_WASI_EMULATED_MMAN )
73
+ /// Similar to `signal.h`, guard against including `sys/mman.h` on WASI unless
74
+ /// `_WASI_EMULATED_MMAN` is enabled.
75
+ # if !TARGET_OS_WASI || defined(_WASI_EMULATED_MMAN )
72
76
# include <sys/mman.h>
73
77
# endif
74
78
#endif
You can’t perform that action at this time.
0 commit comments