Skip to content

Commit cf0de40

Browse files
Merge pull request #5440 from swiftwasm/katei/remove-implicit-emulation-macros
[wasm] Remove implicit _WASI_EMULATED_X macro definition in ClangImporter
2 parents 760e8f8 + 5efd963 commit cf0de40

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -663,10 +663,6 @@ importer::getNormalInvocationArguments(
663663
}
664664

665665
if (triple.isOSWASI()) {
666-
invocationArgStrs.insert(invocationArgStrs.end(),
667-
{"-D_WASI_EMULATED_MMAN",
668-
"-D_WASI_EMULATED_SIGNAL",
669-
"-D_WASI_EMULATED_PROCESS_CLOCKS"});
670666
SmallString<128> buffer;
671667
if (auto path = getWasiLibcModuleMapPath(searchPathOpts, triple, buffer)) {
672668
invocationArgStrs.push_back((Twine("-fmodule-map-file=") + *path).str());

stdlib/public/Platform/SwiftWASILibc.h.gyb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,20 @@ headers = [
105105
]
106106
}%
107107

108+
// FIXME?(katei):
109+
// Those emulations are now enabled by default to have compatibility
110+
// with other platforms as much as possible without any extra modification.
111+
// But we should consider moving them into their own submodules.
112+
#ifndef _WASI_EMULATED_MMAN
113+
# define _WASI_EMULATED_MMAN
114+
#endif
115+
#ifndef _WASI_EMULATED_SIGNAL
116+
# define _WASI_EMULATED_SIGNAL
117+
#endif
118+
#ifndef _WASI_EMULATED_PROCESS_CLOCKS
119+
# define _WASI_EMULATED_PROCESS_CLOCKS
120+
#endif
121+
108122
% for header in headers:
109123
#if __has_include(<${header}>)
110124
#include <${header}>

0 commit comments

Comments
 (0)