1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-21 14:54:47 -05:00
denoland-deno/test_ffi/src/lib.rs

45 lines
694 B
Rust
Raw Normal View History

#[no_mangle]
pub extern "C" fn print_something() {
println!("something");
}
#[no_mangle]
pub extern "C" fn add_u32(a: u32, b: u32) -> u32 {
a + b
}
#[no_mangle]
pub extern "C" fn add_i32(a: i32, b: i32) -> i32 {
a + b
}
#[no_mangle]
pub extern "C" fn add_u64(a: u64, b: u64) -> u64 {
a + b
}
#[no_mangle]
pub extern "C" fn add_i64(a: i64, b: i64) -> i64 {
a + b
}
#[no_mangle]
pub extern "C" fn add_usize(a: usize, b: usize) -> usize {
a + b
}
#[no_mangle]
pub extern "C" fn add_isize(a: isize, b: isize) -> isize {
a + b
}
#[no_mangle]
pub extern "C" fn add_f32(a: f32, b: f32) -> f32 {
a + b
}
#[no_mangle]
pub extern "C" fn add_f64(a: f64, b: f64) -> f64 {
a + b
}