Skip to content

Commit bf3eb65

Browse files
authored
Drop cty dependency now that core::ffi has that covered
Reviewed-on: #14
2 parents e27519b + fd49f28 commit bf3eb65

6 files changed

Lines changed: 7 additions & 7 deletions

File tree

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
name = "riot-sys"
33
version = "0.8.0"
44
authors = ["Christian Amsüss <chrysn@fsfe.org>"]
5-
edition = "2018"
5+
edition = "2021"
6+
rust-version = "1.64"
67

78
description = "Rust FFI wrappers for the RIOT operating system"
89
documentation = "https://rustdoc.etonomy.org/riot_sys/"
@@ -14,7 +15,6 @@ license = "LGPL-2.1"
1415
links = "riot-sys"
1516

1617
[dependencies]
17-
cty = "^0.2"
1818
c2rust-asm-casts = "0.2"
1919
# Relevant for some boards like the wemos-zero
2020
c2rust-bitfields = { version = "0.3", features = ["no_std"] }

build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ fn main() {
189189
.header("riot-bindgen.h")
190190
.clang_args(&cflags)
191191
.use_core()
192-
.ctypes_prefix("libc")
192+
.ctypes_prefix("core::ffi")
193193
// We've traditionally used size_t explicitly and cast it in riot-wrappers; changing this
194194
// now (going from bindgen 0.60 to 0.64) would break where it's used (although we still
195195
// might instate a type alias for size_t later instead).

src/bindgen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
#![allow(rustdoc::invalid_rust_codeblocks)]
99
#![allow(rustdoc::broken_intra_doc_links)]
1010

11-
use crate::libc;
11+
use core::ffi as libc;
1212

1313
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));

src/inline.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ macro_rules! llvm_asm {
8787
}};
8888
}
8989

90-
use cty as libc;
90+
use core::ffi as libc;
9191

9292
use c2rust_bitfields::*;
9393

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@
122122
#![allow(non_snake_case)]
123123
#![cfg_attr(feature = "keep-extern-types", feature(extern_types))]
124124

125+
#[deprecated(note = "Use core::ffi types directly")]
125126
pub mod libc;
126127

127128
mod intrinsics_replacements;

src/libc.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
#![allow(non_camel_case_types)]
77

8-
pub use cty::{
8+
pub use core::ffi::{
99
c_char,
1010
c_double,
1111
c_float,
@@ -22,5 +22,4 @@ pub use cty::{
2222
// Not even loading size_t and ssize_t as they don't fit with bindgen's mapping anyway
2323
};
2424

25-
// Used to be a dedicated type, pub-used to avoid breaking the API
2625
pub use core::ffi::c_void;

0 commit comments

Comments
 (0)