Add Sample Functions to Library

This commit is contained in:
GuilhermeWerner
2021-01-21 12:35:08 -03:00
parent 55ef94f93f
commit 89085ce699
2 changed files with 23 additions and 3 deletions

View File

@ -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;
}