diff --git a/Cargo.toml b/Cargo.toml index 27e446a..545f513 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,8 @@ name = "riot-sys" version = "0.7.9" authors = ["Christian Amsüss "] -edition = "2018" +edition = "2021" +rust-version = "1.64" description = "Rust FFI wrappers for the RIOT operating system" documentation = "https://rustdoc.etonomy.org/riot_sys/" @@ -14,7 +15,6 @@ license = "LGPL-2.1" links = "riot-sys" [dependencies] -cty = "^0.2" c2rust-asm-casts = "0.2" # Relevant for some boards like the wemos-zero c2rust-bitfields = { version = "0.3", features = ["no_std"] } diff --git a/build.rs b/build.rs index a98531c..7926d47 100644 --- a/build.rs +++ b/build.rs @@ -179,7 +179,7 @@ fn main() { .header("riot-bindgen.h") .clang_args(&cflags) .use_core() - .ctypes_prefix("libc") + .ctypes_prefix("core::ffi") .impl_debug(true) // Structs listed here are Packed and thus need impl_debug, but also contain non-Copy // members. diff --git a/src/bindgen.rs b/src/bindgen.rs index 8f5a22c..54303d0 100644 --- a/src/bindgen.rs +++ b/src/bindgen.rs @@ -3,6 +3,6 @@ //! These are kept in a separate module (rather than including the bindings right in the lib.rs) //! because bindgen is a bit sensitive to some of its assignments being defined differently -use crate::libc; +use core::ffi as libc; include!(concat!(env!("OUT_DIR"), "/bindings.rs")); diff --git a/src/inline.rs b/src/inline.rs index 60d0b02..771a28e 100644 --- a/src/inline.rs +++ b/src/inline.rs @@ -87,7 +87,7 @@ macro_rules! llvm_asm { }}; } -use cty as libc; +use core::ffi as libc; use c2rust_bitfields::*; diff --git a/src/lib.rs b/src/lib.rs index 657a469..7131ce3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -89,6 +89,7 @@ #![allow(non_snake_case)] #![cfg_attr(feature = "keep-extern-types", feature(extern_types))] +#[deprecated(note = "Use core::ffi types directly")] pub mod libc; mod intrinsics_replacements; diff --git a/src/libc.rs b/src/libc.rs index eec0254..5a3a303 100644 --- a/src/libc.rs +++ b/src/libc.rs @@ -5,7 +5,7 @@ #![allow(non_camel_case_types)] -pub use cty::{ +pub use core::ffi::{ c_char, c_double, c_float, @@ -22,5 +22,4 @@ pub use cty::{ // Not even loading size_t and ssize_t as they don't fit with bindgen's mapping anyway }; -// Used to be a dedicated type, pub-used to avoid breaking the API pub use core::ffi::c_void;