diff --git a/lib/ClangImporter/ClangImporter.cpp b/lib/ClangImporter/ClangImporter.cpp index 3ebdc3ee4f279..c82af4b32686d 100644 --- a/lib/ClangImporter/ClangImporter.cpp +++ b/lib/ClangImporter/ClangImporter.cpp @@ -663,10 +663,6 @@ importer::getNormalInvocationArguments( } if (triple.isOSWASI()) { - invocationArgStrs.insert(invocationArgStrs.end(), - {"-D_WASI_EMULATED_MMAN", - "-D_WASI_EMULATED_SIGNAL", - "-D_WASI_EMULATED_PROCESS_CLOCKS"}); SmallString<128> buffer; if (auto path = getWasiLibcModuleMapPath(searchPathOpts, triple, buffer)) { invocationArgStrs.push_back((Twine("-fmodule-map-file=") + *path).str()); diff --git a/stdlib/public/Platform/SwiftWASILibc.h.gyb b/stdlib/public/Platform/SwiftWASILibc.h.gyb index 86fc25b24c833..c051627f2b7c0 100644 --- a/stdlib/public/Platform/SwiftWASILibc.h.gyb +++ b/stdlib/public/Platform/SwiftWASILibc.h.gyb @@ -105,6 +105,20 @@ headers = [ ] }% +// FIXME?(katei): +// Those emulations are now enabled by default to have compatibility +// with other platforms as much as possible without any extra modification. +// But we should consider moving them into their own submodules. +#ifndef _WASI_EMULATED_MMAN +# define _WASI_EMULATED_MMAN +#endif +#ifndef _WASI_EMULATED_SIGNAL +# define _WASI_EMULATED_SIGNAL +#endif +#ifndef _WASI_EMULATED_PROCESS_CLOCKS +# define _WASI_EMULATED_PROCESS_CLOCKS +#endif + % for header in headers: #if __has_include(<${header}>) #include <${header}>