gen_wasm use dummy platform functions

This commit is contained in:
Folkert de Vries 2022-08-03 21:35:28 +02:00
parent fe707a9d6c
commit 7f4e0bb0c9
3 changed files with 48 additions and 44 deletions

View file

@ -264,3 +264,10 @@ pub const DEBUG_SETTINGS: WasmDebugSettings = WasmDebugSettings {
keep_test_binary: false && cfg!(debug_assertions),
skip_dead_code_elim: false && cfg!(debug_assertions),
};
#[cfg(test)]
mod dummy_platform_functions {
// `cargo test` produces an executable. At least on Windows, this means that extern symbols must be defined. This crate imports roc_std which
// defines a bunch of externs, and uses the three below. We provide dummy implementations because these functions are not called.
pub use roc_std::platform_dummys::{roc_alloc, roc_dealloc, roc_realloc};
}