aboutsummaryrefslogtreecommitdiff
path: root/examples/add.rs
blob: ad01074d1dcf9db42525bf164572b93f98ca4c10 (plain) (blame)
1
2
3
4
5
6
7
#[no_mangle]
pub extern "C" fn add(a: i32, b: i32) -> i32 {
    a + b
}

// to compile:
// rustc --crate-type cdylib add.rs