Skip to content

Commit 12a7ddf

Browse files
Do not include <sys/resource.h> on WASI
Including `sys/resource.h` from wasi-libc requires a feature macro to be defined (`-D_WASI_EMULATED_PROCESS_CLOCKS`) and emits compilation errors otherwise. However, the header is not used in WASI paths, so it is safe to exclude it from the list of includes. See `sys/times.h` that is transitively included by `sys/resource.h` https://github.com/WebAssembly/wasi-libc/blob/wasi-sdk-22/libc-top-half/musl/include/sys/times.h
1 parent 090e9c8 commit 12a7ddf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/_TestingInternals/include/Includes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
#include <sys/fcntl.h>
5959
#endif
6060

61-
#if __has_include(<sys/resource.h>)
61+
#if __has_include(<sys/resource.h>) && !defined(__wasi__)
6262
#include <sys/resource.h>
6363
#endif
6464

0 commit comments

Comments
 (0)