diff options
| author | nic-gaffney <gaffney_nic@protonmail.com> | 2023-06-25 22:26:53 -0500 |
|---|---|---|
| committer | nic-gaffney <gaffney_nic@protonmail.com> | 2023-06-25 22:26:53 -0500 |
| commit | a7454f42bab35400eb8a651e4dfb8ef4a596e713 (patch) | |
| tree | e3cdfd276dbf1dfa49de0261394fbdb8964cd34f | |
| parent | debb3b9a9c2cab0791396f008af7021968121001 (diff) | |
| download | sloth-a7454f42bab35400eb8a651e4dfb8ef4a596e713.tar.gz | |
removed old standard libarby
| -rw-r--r-- | sloth/src/sloth_std.rs | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/sloth/src/sloth_std.rs b/sloth/src/sloth_std.rs deleted file mode 100644 index 7e10297..0000000 --- a/sloth/src/sloth_std.rs +++ /dev/null @@ -1,26 +0,0 @@ -use std::ffi::{c_char, CStr}; - -use rand::Rng; - -#[no_mangle] -pub extern "C" fn rand(a: i64, b: i64) -> i64 { - rand::thread_rng().gen_range(a..b) -} - -#[no_mangle] -/// # Safety -/// -/// Function is unsafe if passed pointer is not a valid CStr -pub unsafe extern "C" fn println(s: *const c_char) { - let s = unsafe { CStr::from_ptr(s) }.to_str().unwrap(); - println!("{s}"); -} - -#[no_mangle] -/// # Safety -/// -/// Function is unsafe if passed pointer is not a valid CStr -pub unsafe extern "C" fn print(s: *const c_char) { - let s = unsafe { CStr::from_ptr(s) }.to_str().unwrap(); - print!("{s}"); -} |
