Last active
May 28, 2019 14:03
-
-
Save Hywan/7217487ffa1a6725e1a5fb6a9cebdd88 to your computer and use it in GitHub Desktop.
Go Wasm example, import.rs
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
extern { | |
fn sum(x: i32, y: i32) -> i32; | |
} | |
#[no_mangle] | |
pub extern fn add1(x: i32, y: i32) -> i32 { | |
unsafe { sum(x, y) } + 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment