Skip to content

Commit

Permalink
Require rust >= 1.30 and drop libc_core_cvoid conditional
Browse files Browse the repository at this point in the history
Move the `c_void` re-export to the top-level `lib.rs`.

(apply <rust-lang#4060> to `main`)
(cherry picked from commit e221887)
  • Loading branch information
joshtriplett authored and tgross35 committed Nov 17, 2024
1 parent b67829f commit 7dd0600
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 20 deletions.
4 changes: 2 additions & 2 deletions src/fuchsia/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
//! More functions and definitions can be found in the more specific modules
//! according to the platform in question.
use c_void;

// PUB_TYPE

pub type c_schar = i8;
Expand Down Expand Up @@ -4486,5 +4488,3 @@ cfg_if! {
// Unknown target_arch
}
}

pub use ffi::c_void;
4 changes: 2 additions & 2 deletions src/hermit.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//! Hermit C type definitions
use c_void;

cfg_if! {
if #[cfg(any(target_arch = "aarch64", target_arch = "riscv64"))] {
pub type c_char = u8;
Expand Down Expand Up @@ -576,5 +578,3 @@ extern "C" {
#[link_name = "sys_poll"]
pub fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: i32) -> i32;
}

pub use ffi::c_void;
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ use core::num;
#[allow(unused_imports)]
use core::option::Option;

pub use core::ffi::c_void;

cfg_if! {
if #[cfg(windows)] {
mod fixed_width_ints;
Expand Down
2 changes: 0 additions & 2 deletions src/sgx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,3 @@ pub type c_ulong = u64;

pub const INT_MIN: c_int = -2147483648;
pub const INT_MAX: c_int = 2147483647;

pub use ffi::c_void;
4 changes: 2 additions & 2 deletions src/solid/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
//!
//! [SOLID]: https://solid.kmckk.com/
use c_void;

pub type c_schar = i8;
pub type c_uchar = u8;
pub type c_short = i16;
Expand Down Expand Up @@ -871,8 +873,6 @@ extern "C" {
pub fn lseek(arg1: c_int, arg2: __off_t, arg3: c_int) -> __off_t;
}

pub use ffi::c_void;

cfg_if! {
if #[cfg(target_arch = "aarch64")] {
mod aarch64;
Expand Down
2 changes: 0 additions & 2 deletions src/switch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,3 @@ pub type wchar_t = u32;

pub const INT_MIN: c_int = -2147483648;
pub const INT_MAX: c_int = 2147483647;

pub use ffi::c_void;
4 changes: 2 additions & 2 deletions src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
//! More functions and definitions can be found in the more specific modules
//! according to the platform in question.
use c_void;

pub type c_schar = i8;
pub type c_uchar = u8;
pub type c_short = i16;
Expand Down Expand Up @@ -1688,5 +1690,3 @@ cfg_if! {
// Unknown target_os
}
}

pub use ffi::c_void;
3 changes: 1 addition & 2 deletions src/vxworks/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! Interface to VxWorks C library
use c_void;
use core::mem::size_of;
use core::ptr::null_mut;

Expand Down Expand Up @@ -2013,8 +2014,6 @@ pub unsafe fn posix_memalign(
}
}

pub use ffi::c_void;

cfg_if! {
if #[cfg(target_arch = "aarch64")] {
mod aarch64;
Expand Down
3 changes: 1 addition & 2 deletions src/wasi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
// `wasi-libc` project provides multiple libraries including emulated features, but we list only basic features with `libc.a` here.

use super::{Send, Sync};
use c_void;
use core::iter::Iterator;

pub use ffi::c_void;

pub type c_char = i8;
pub type c_uchar = u8;
pub type c_schar = i8;
Expand Down
4 changes: 2 additions & 2 deletions src/windows/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//! Windows CRT definitions
use c_void;

pub type c_schar = i8;
pub type c_uchar = u8;
pub type c_short = i16;
Expand Down Expand Up @@ -565,8 +567,6 @@ extern "system" {
pub fn socket(af: ::c_int, socket_type: ::c_int, protocol: ::c_int) -> SOCKET;
}

pub use ffi::c_void;

cfg_if! {
if #[cfg(all(target_env = "gnu"))] {
mod gnu;
Expand Down
2 changes: 0 additions & 2 deletions src/xous.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,3 @@ pub type wchar_t = u32;

pub const INT_MIN: c_int = -2147483648;
pub const INT_MAX: c_int = 2147483647;

pub use ffi::c_void;

0 comments on commit 7dd0600

Please sign in to comment.