mirror of
https://github.com/guilhermewerner/rust-ffi
synced 2025-06-16 05:44:19 +00:00
24 lines
460 B
Rust
24 lines
460 B
Rust
#![allow(dead_code)]
|
|
#![allow(unused_variables)]
|
|
#![allow(non_snake_case)]
|
|
|
|
#[no_mangle]
|
|
pub extern "C" fn Add(num1: f32, num2: f32) -> f32 {
|
|
return num1 + num2;
|
|
}
|
|
|
|
#[no_mangle]
|
|
pub extern "C" fn Subtract(num1: f32, num2: f32) -> f32 {
|
|
return num1 - num2;
|
|
}
|
|
|
|
#[no_mangle]
|
|
pub extern "C" fn Multiply(num1: f32, num2: f32) -> f32 {
|
|
return num1 * num2;
|
|
}
|
|
|
|
#[no_mangle]
|
|
pub extern "C" fn Divide(num1: f32, num2: f32) -> f32 {
|
|
return num1 / num2;
|
|
}
|