feat: add example4
This commit is contained in:
12
__wasm/wasmtime/wasms/simple_rust_wasm/src/lib.rs
Normal file
12
__wasm/wasmtime/wasms/simple_rust_wasm/src/lib.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
#[link(wasm_import_module = "host")]
|
||||
extern "C" {
|
||||
|
||||
#[link_name = "hello"]
|
||||
fn host_hello(a: i32);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn hello() {
|
||||
unsafe { host_hello(3); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user