Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop cty dependency now that core::ffi has that covered #14

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
name = "riot-sys"
version = "0.7.9"
authors = ["Christian Amsüss <[email protected]>"]
edition = "2018"
edition = "2021"
rust-version = "1.64"

description = "Rust FFI wrappers for the RIOT operating system"
documentation = "https://rustdoc.etonomy.org/riot_sys/"
Expand All @@ -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"] }
Expand Down
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/bindgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
2 changes: 1 addition & 1 deletion src/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ macro_rules! llvm_asm {
}};
}

use cty as libc;
use core::ffi as libc;

use c2rust_bitfields::*;

Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions src/libc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#![allow(non_camel_case_types)]

pub use cty::{
pub use core::ffi::{
c_char,
c_double,
c_float,
Expand All @@ -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;