[Bug] Fix breakages that occur when targeting WASM with Emscripten. (#422)

We don't import either architecture in archtraits so include
environment.h to ensure Environment is visible, and don't use
__builtin__clear_cache in Emscripten because it's unsupported.
This commit is contained in:
smcallis
2023-11-15 01:15:30 -07:00
committed by GitHub
parent b2a01018ad
commit dbfe3900e4
2 changed files with 2 additions and 1 deletions

View File

@@ -5,6 +5,7 @@
#include "../core/api-build_p.h"
#include "../core/archtraits.h"
#include "../core/environment.h"
#include "../core/misc_p.h"
#if !defined(ASMJIT_NO_X86)

View File

@@ -852,7 +852,7 @@ Error releaseDualMapping(DualMapping* dm, size_t size) noexcept {
// ========================================
void flushInstructionCache(void* p, size_t size) noexcept {
#if ASMJIT_ARCH_X86
#if ASMJIT_ARCH_X86 || defined(__EMSCRIPTEN__)
// X86/X86_64 architecture doesn't require to do anything to flush instruction cache.
DebugUtils::unused(p, size);
#elif defined(__APPLE__)