diff --git a/Cargo.toml b/Cargo.toml index 0e2ee82..0846764 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ publish = false [lib] name="Library" -crate-type = ["cdylib"] +crate-type = ["staticlib", "cdylib", "rlib"] path = "Source/Library.rs" [dependencies] diff --git a/Source/Library.rs b/Source/Library.rs index 208ebd8..0256e09 100644 --- a/Source/Library.rs +++ b/Source/Library.rs @@ -1,3 +1,23 @@ -pub fn Hello() { - println!("Hello Library"); +#![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; }