Skip to content

Commit 6d894f1

Browse files
joshtripletttgross35
authored andcommittedNov 17, 2024
Require rust >= 1.30 and drop libc_core_cvoid conditional
Move the `c_void` re-export to the top-level `lib.rs`. (apply <rust-lang#4060> to `main`) (cherry picked from commit e221887) Changes are reduced in this cherry pick compared to the original commit because some of this was already applied to `main`.
1 parent a26e54b commit 6d894f1

File tree

11 files changed

+14
-20
lines changed

11 files changed

+14
-20
lines changed
 

‎src/fuchsia/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
//! More functions and definitions can be found in the more specific modules
44
//! according to the platform in question.
55
6+
use c_void;
7+
68
// PUB_TYPE
79

810
pub type c_schar = i8;
@@ -4486,5 +4488,3 @@ cfg_if! {
44864488
// Unknown target_arch
44874489
}
44884490
}
4489-
4490-
pub use ffi::c_void;

‎src/hermit.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//! Hermit C type definitions
22
3+
use c_void;
4+
35
cfg_if! {
46
if #[cfg(any(target_arch = "aarch64", target_arch = "riscv64"))] {
57
pub type c_char = u8;
@@ -576,5 +578,3 @@ extern "C" {
576578
#[link_name = "sys_poll"]
577579
pub fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: i32) -> i32;
578580
}
579-
580-
pub use ffi::c_void;

‎src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ use core::num;
6161
#[allow(unused_imports)]
6262
use core::option::Option;
6363

64+
pub use core::ffi::c_void;
65+
6466
cfg_if! {
6567
if #[cfg(windows)] {
6668
mod fixed_width_ints;

‎src/sgx.rs

-2
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,3 @@ pub type c_ulong = u64;
2525

2626
pub const INT_MIN: c_int = -2147483648;
2727
pub const INT_MAX: c_int = 2147483647;
28-
29-
pub use ffi::c_void;

‎src/solid/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
//!
33
//! [SOLID]: https://solid.kmckk.com/
44
5+
use c_void;
6+
57
pub type c_schar = i8;
68
pub type c_uchar = u8;
79
pub type c_short = i16;
@@ -871,8 +873,6 @@ extern "C" {
871873
pub fn lseek(arg1: c_int, arg2: __off_t, arg3: c_int) -> __off_t;
872874
}
873875

874-
pub use ffi::c_void;
875-
876876
cfg_if! {
877877
if #[cfg(target_arch = "aarch64")] {
878878
mod aarch64;

‎src/switch.rs

-2
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,3 @@ pub type wchar_t = u32;
2727

2828
pub const INT_MIN: c_int = -2147483648;
2929
pub const INT_MAX: c_int = 2147483647;
30-
31-
pub use ffi::c_void;

‎src/unix/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
//! More functions and definitions can be found in the more specific modules
44
//! according to the platform in question.
55
6+
use c_void;
7+
68
pub type c_schar = i8;
79
pub type c_uchar = u8;
810
pub type c_short = i16;
@@ -1688,5 +1690,3 @@ cfg_if! {
16881690
// Unknown target_os
16891691
}
16901692
}
1691-
1692-
pub use ffi::c_void;

‎src/vxworks/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! Interface to VxWorks C library
22
3+
use c_void;
34
use core::mem::size_of;
45
use core::ptr::null_mut;
56

@@ -2013,8 +2014,6 @@ pub unsafe fn posix_memalign(
20132014
}
20142015
}
20152016

2016-
pub use ffi::c_void;
2017-
20182017
cfg_if! {
20192018
if #[cfg(target_arch = "aarch64")] {
20202019
mod aarch64;

‎src/wasi/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
// `wasi-libc` project provides multiple libraries including emulated features, but we list only basic features with `libc.a` here.
33

44
use super::{Send, Sync};
5+
use c_void;
56
use core::iter::Iterator;
67

7-
pub use ffi::c_void;
8-
98
pub type c_char = i8;
109
pub type c_uchar = u8;
1110
pub type c_schar = i8;

‎src/windows/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//! Windows CRT definitions
22
3+
use c_void;
4+
35
pub type c_schar = i8;
46
pub type c_uchar = u8;
57
pub type c_short = i16;
@@ -565,8 +567,6 @@ extern "system" {
565567
pub fn socket(af: ::c_int, socket_type: ::c_int, protocol: ::c_int) -> SOCKET;
566568
}
567569

568-
pub use ffi::c_void;
569-
570570
cfg_if! {
571571
if #[cfg(all(target_env = "gnu"))] {
572572
mod gnu;

‎src/xous.rs

-2
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,3 @@ pub type wchar_t = u32;
2727

2828
pub const INT_MIN: c_int = -2147483648;
2929
pub const INT_MAX: c_int = 2147483647;
30-
31-
pub use ffi::c_void;

0 commit comments

Comments
 (0)