diff --git a/Cargo.toml b/Cargo.toml index b104ceb..8932df0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ repository = "https://gitlab.com/CyberMages/Core/pact.git" documentation = "" keywords = ["c", "libc", "binding", "ffi", "pact", "nostd"] build = "build.rs" -edition = "2021" +edition = "2024" [features] @@ -18,7 +18,6 @@ rust_lib = [] no_mem_manip = [] weak = [] +[dependencies] +binding = { version = "0.1.0", registry = "cybermages" } - -[dependencies.binding] -git = "ssh://gitea@workshop.cybermages.tech:3022/CyberMages/binding.git" diff --git a/src/c/errno.rs b/src/c/errno.rs index 5795e85..c7265ce 100644 --- a/src/c/errno.rs +++ b/src/c/errno.rs @@ -182,7 +182,7 @@ fn set_errno(errnum: i32) // The function to get the errno memory location. -extern +unsafe extern "C" { fn __errno_location() -> *mut CInt; } diff --git a/src/c/math.rs b/src/c/math.rs index e24d181..91849f0 100644 --- a/src/c/math.rs +++ b/src/c/math.rs @@ -3,7 +3,7 @@ use binding::{CFloat, CDouble, CInt}; // Taken from: https://en.wikipedia.org/wiki/C_mathematical_functions #[link(name="m")] -extern +unsafe extern "C" { // Basic functions. pub fn fabs(arg: CDouble) -> CDouble; diff --git a/src/c/stdio.rs b/src/c/stdio.rs index 0d12472..1845ad7 100644 --- a/src/c/stdio.rs +++ b/src/c/stdio.rs @@ -8,7 +8,7 @@ pub enum FILE -extern +unsafe extern "C" { pub fn fileno(stream: *mut FILE) -> CInt; pub fn fopen(filename: *const CChar, mode: *const CChar) -> *mut FILE; diff --git a/src/c/stdlib.rs b/src/c/stdlib.rs index 2c510b3..f8a4458 100644 --- a/src/c/stdlib.rs +++ b/src/c/stdlib.rs @@ -2,7 +2,7 @@ use binding::CVoid; #[link(name="c")] -extern +unsafe extern "C" { pub fn calloc(nobj: usize, size: usize) -> *mut CVoid; pub fn malloc(size: usize) -> *mut CVoid; diff --git a/src/c/string.rs b/src/c/string.rs index cd4540e..126244c 100644 --- a/src/c/string.rs +++ b/src/c/string.rs @@ -5,7 +5,7 @@ use crate::stddef::{size_t, wchar_t}; #[cfg(not(feature="no_mem_manip"))] #[link(name="c")] -extern +unsafe extern "C" { /// Copies the values of n bytes from the location pointed to by /// src directly to the memory block pointed to by dest. @@ -56,7 +56,7 @@ extern } #[link(name="c")] -extern +unsafe extern "C" { pub fn strcpy(dst: *mut CChar, src: *const CChar) -> *mut CChar; pub fn strncpy(dst: *mut CChar, src: *const CChar, diff --git a/src/c/time.rs b/src/c/time.rs index 9e159b4..07812fc 100644 --- a/src/c/time.rs +++ b/src/c/time.rs @@ -46,7 +46,7 @@ pub struct LocalTime #[link(name="c")] -extern +unsafe extern "C" { /// Uses the value pointed by time to fill a LocalTime structure with /// the values that represent the corresponding time, expressed