Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit 09e6e53

Browse files
committed
Switch to a WASI define
1 parent 7e41ca9 commit 09e6e53

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/Basic/Targets/WebAssembly.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ void WebAssemblyTargetInfo::fillValidCPUList(
5353
void WebAssemblyTargetInfo::getTargetDefines(const LangOptions &Opts,
5454
MacroBuilder &Builder) const {
5555
defineCPUMacros(Builder, "wasm", /*Tuning=*/false);
56-
// HACK: too lazy to backport the -emscripten target here
57-
Builder.defineMacro("__EMSCRIPTEN__");
56+
// HACK: too lazy to backport the WASI target here
57+
Builder.defineMacro("__wasi__");
58+
// HACK: globally enable WASI mmap emulation
59+
Builder.defineMacro("_WASI_EMULATED_MMAN");
5860
if (SIMDLevel >= SIMD128)
5961
Builder.defineMacro("__wasm_simd128__");
6062
}

0 commit comments

Comments
 (0)