mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-22 20:47:48 +00:00
24 lines
302 B
Rust
24 lines
302 B
Rust
![]() |
#![crate_type = "cdylib"]
|
||
|
|
||
|
mod a {
|
||
|
#[link(wasm_import_module = "a")]
|
||
|
extern "C" {
|
||
|
pub fn foo();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
mod b {
|
||
|
#[link(wasm_import_module = "b")]
|
||
|
extern "C" {
|
||
|
pub fn foo();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
#[no_mangle]
|
||
|
pub fn start() {
|
||
|
unsafe {
|
||
|
a::foo();
|
||
|
b::foo();
|
||
|
}
|
||
|
}
|