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

Commit bfaa96e

Browse files
zhuoweiMaxDesiatov
authored andcommitted
Switch to a WASI define
1 parent 44c0dde commit bfaa96e

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
@@ -60,8 +60,10 @@ void WebAssemblyTargetInfo::fillValidCPUList(
6060
void WebAssemblyTargetInfo::getTargetDefines(const LangOptions &Opts,
6161
MacroBuilder &Builder) const {
6262
defineCPUMacros(Builder, "wasm", /*Tuning=*/false);
63-
// HACK: too lazy to backport the -emscripten target here
64-
Builder.defineMacro("__EMSCRIPTEN__");
63+
// HACK: too lazy to backport the WASI target here
64+
Builder.defineMacro("__wasi__");
65+
// HACK: globally enable WASI mmap emulation
66+
Builder.defineMacro("_WASI_EMULATED_MMAN");
6567
if (SIMDLevel >= SIMD128)
6668
Builder.defineMacro("__wasm_simd128__");
6769
if (SIMDLevel >= UnimplementedSIMD128)

0 commit comments

Comments
 (0)