Created
March 20, 2025 02:54
-
-
Save TheWaWaR/d614570142527b1b6511050b63e78d39 to your computer and use it in GitHub Desktop.
Define wasm import module name in Rust
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[link(wasm_import_module = "lunar")] | |
unsafe extern "C" { | |
pub fn get_renderer(input_length: usize) -> i64; | |
} | |
#[unsafe(no_mangle)] | |
pub extern "C" fn add_u32(a: u32, b: u32) -> u32 { | |
unsafe { | |
let _ = get_renderer(33usize); | |
} | |
a + b | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment