From 8448147a26b338a9e92afa82bedbdbcc3655daa7 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Wed, 18 Dec 2024 10:39:37 +0900 Subject: [PATCH 1/3] Define c_char at top-level and remove per-target c_char definitions (backport ) (cherry picked from commit 0a02b941cf105dc4d4c5b5bd1ddc7bb546ad89c9) --- libc-test/build.rs | 36 +---------- src/fuchsia/aarch64.rs | 1 - src/fuchsia/riscv64.rs | 1 - src/fuchsia/x86_64.rs | 1 - src/hermit.rs | 1 - src/lib.rs | 64 +++++++++---------- src/sgx.rs | 1 - src/solid/aarch64.rs | 1 - src/solid/arm.rs | 1 - src/switch.rs | 1 - src/teeos/mod.rs | 3 - src/trusty.rs | 1 - src/unix/aix/mod.rs | 1 - src/unix/bsd/apple/mod.rs | 1 - src/unix/bsd/freebsdlike/dragonfly/mod.rs | 1 - src/unix/bsd/freebsdlike/freebsd/aarch64.rs | 1 - src/unix/bsd/freebsdlike/freebsd/arm.rs | 1 - src/unix/bsd/freebsdlike/freebsd/powerpc.rs | 1 - src/unix/bsd/freebsdlike/freebsd/powerpc64.rs | 1 - src/unix/bsd/freebsdlike/freebsd/riscv64.rs | 1 - src/unix/bsd/freebsdlike/freebsd/x86.rs | 1 - .../bsd/freebsdlike/freebsd/x86_64/mod.rs | 1 - src/unix/bsd/netbsdlike/netbsd/aarch64.rs | 1 - src/unix/bsd/netbsdlike/netbsd/arm.rs | 1 - src/unix/bsd/netbsdlike/netbsd/mips.rs | 1 - src/unix/bsd/netbsdlike/netbsd/powerpc.rs | 1 - src/unix/bsd/netbsdlike/netbsd/riscv64.rs | 1 - src/unix/bsd/netbsdlike/netbsd/sparc64.rs | 1 - src/unix/bsd/netbsdlike/netbsd/x86.rs | 1 - src/unix/bsd/netbsdlike/netbsd/x86_64.rs | 1 - src/unix/bsd/netbsdlike/openbsd/aarch64.rs | 1 - src/unix/bsd/netbsdlike/openbsd/arm.rs | 1 - src/unix/bsd/netbsdlike/openbsd/mips64.rs | 1 - src/unix/bsd/netbsdlike/openbsd/powerpc.rs | 1 - src/unix/bsd/netbsdlike/openbsd/powerpc64.rs | 1 - src/unix/bsd/netbsdlike/openbsd/riscv64.rs | 1 - src/unix/bsd/netbsdlike/openbsd/sparc64.rs | 1 - src/unix/bsd/netbsdlike/openbsd/x86.rs | 1 - src/unix/bsd/netbsdlike/openbsd/x86_64.rs | 1 - src/unix/haiku/mod.rs | 1 - src/unix/hurd/mod.rs | 2 - src/unix/linux_like/android/b32/arm.rs | 1 - src/unix/linux_like/android/b32/x86/mod.rs | 1 - .../linux_like/android/b64/aarch64/mod.rs | 1 - .../linux_like/android/b64/riscv64/mod.rs | 1 - src/unix/linux_like/android/b64/x86_64/mod.rs | 1 - src/unix/linux_like/emscripten/mod.rs | 1 - src/unix/linux_like/linux/gnu/b32/arm/mod.rs | 1 - src/unix/linux_like/linux/gnu/b32/csky/mod.rs | 1 - src/unix/linux_like/linux/gnu/b32/m68k/mod.rs | 1 - src/unix/linux_like/linux/gnu/b32/mips/mod.rs | 1 - src/unix/linux_like/linux/gnu/b32/powerpc.rs | 1 - .../linux_like/linux/gnu/b32/riscv32/mod.rs | 1 - .../linux_like/linux/gnu/b32/sparc/mod.rs | 1 - src/unix/linux_like/linux/gnu/b32/x86/mod.rs | 1 - .../linux_like/linux/gnu/b64/aarch64/mod.rs | 1 - .../linux/gnu/b64/loongarch64/mod.rs | 1 - .../linux_like/linux/gnu/b64/mips64/mod.rs | 1 - .../linux_like/linux/gnu/b64/powerpc64/mod.rs | 1 - .../linux_like/linux/gnu/b64/riscv64/mod.rs | 1 - src/unix/linux_like/linux/gnu/b64/s390x.rs | 1 - .../linux_like/linux/gnu/b64/sparc64/mod.rs | 1 - .../linux_like/linux/gnu/b64/x86_64/mod.rs | 1 - src/unix/linux_like/linux/musl/b32/arm/mod.rs | 1 - src/unix/linux_like/linux/musl/b32/hexagon.rs | 1 - .../linux_like/linux/musl/b32/mips/mod.rs | 1 - src/unix/linux_like/linux/musl/b32/powerpc.rs | 1 - .../linux_like/linux/musl/b32/riscv32/mod.rs | 1 - src/unix/linux_like/linux/musl/b32/x86/mod.rs | 1 - .../linux_like/linux/musl/b64/aarch64/mod.rs | 1 - .../linux/musl/b64/loongarch64/mod.rs | 1 - src/unix/linux_like/linux/musl/b64/mips64.rs | 1 - .../linux_like/linux/musl/b64/powerpc64.rs | 1 - .../linux_like/linux/musl/b64/riscv64/mod.rs | 1 - src/unix/linux_like/linux/musl/b64/s390x.rs | 1 - .../linux_like/linux/musl/b64/x86_64/mod.rs | 1 - src/unix/linux_like/linux/uclibc/arm/mod.rs | 1 - .../linux/uclibc/mips/mips32/mod.rs | 1 - .../linux/uclibc/mips/mips64/mod.rs | 1 - .../linux_like/linux/uclibc/x86_64/mod.rs | 1 - src/unix/newlib/aarch64/mod.rs | 1 - src/unix/newlib/arm/mod.rs | 1 - src/unix/newlib/espidf/mod.rs | 1 - src/unix/newlib/horizon/mod.rs | 1 - src/unix/newlib/powerpc/mod.rs | 1 - src/unix/newlib/vita/mod.rs | 1 - src/unix/nto/aarch64.rs | 1 - src/unix/nto/x86_64.rs | 1 - src/unix/nuttx/mod.rs | 1 - src/unix/redox/mod.rs | 1 - src/unix/solarish/mod.rs | 1 - src/vxworks/aarch64.rs | 1 - src/vxworks/arm.rs | 1 - src/vxworks/powerpc.rs | 1 - src/vxworks/powerpc64.rs | 1 - src/vxworks/riscv32.rs | 1 - src/vxworks/riscv64.rs | 1 - src/vxworks/x86.rs | 1 - src/vxworks/x86_64.rs | 1 - src/wasi/mod.rs | 1 - src/windows/mod.rs | 1 - src/xous.rs | 1 - 102 files changed, 30 insertions(+), 173 deletions(-) diff --git a/libc-test/build.rs b/libc-test/build.rs index d35101d4cae39..a82ae56e2e81e 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -364,9 +364,6 @@ fn test_apple(target: &str) { // FIXME: "'__uint128' undeclared" in C "__uint128" => true, - // `c_char_def` is always public but not always reexported. - "c_char_def" => true, - _ => false, } }); @@ -766,8 +763,6 @@ fn test_windows(target: &str) { "ssize_t" if !gnu => true, // FIXME: The size and alignment of this type are incorrect "time_t" if gnu && i686 => true, - // `c_char_def` is always public but not always reexported. - "c_char_def" => true, _ => false, }); @@ -985,8 +980,6 @@ fn test_solarish(target: &str) { cfg.skip_type(move |ty| match ty { "sighandler_t" => true, - // `c_char_def` is always public but not always reexported. - "c_char_def" => true, _ => false, }); @@ -1290,8 +1283,6 @@ fn test_netbsd(target: &str) { match ty { // FIXME: sighandler_t is crazy across platforms "sighandler_t" => true, - // `c_char_def` is always public but not always reexported. - "c_char_def" => true, _ => false, } }); @@ -1511,8 +1502,6 @@ fn test_dragonflybsd(target: &str) { match ty { // sighandler_t is crazy across platforms "sighandler_t" => true, - // `c_char_def` is always public but not always reexported. - "c_char_def" => true, _ => false, } }); @@ -1674,8 +1663,6 @@ fn test_wasi(target: &str) { } }); - cfg.skip_type(|ty| ty == "c_char_def"); - // These have a different and internal type in header files and are only // used here to generate a pointer to them in bindings so skip these tests. cfg.skip_static(|c| c.starts_with("_CLOCK_")); @@ -1924,9 +1911,6 @@ fn test_android(target: &str) { // FIXME: "'__uint128' undeclared" in C "__uint128" => true, - // `c_char_def` is always public but not always reexported. - "c_char_def" => true, - _ => false, } }); @@ -2689,9 +2673,6 @@ fn test_freebsd(target: &str) { // `eventfd(2)` and things come with it are added in FreeBSD 13 "eventfd_t" if Some(13) > freebsd_ver => true, - // `c_char_def` is always public but not always reexported. - "c_char_def" => true, - _ => false, } }); @@ -3012,9 +2993,6 @@ fn test_emscripten(target: &str) { // https://github.com/emscripten-core/emscripten/issues/5033 ty if ty.starts_with("epoll") => true, - // `c_char_def` is always public but not always reexported. - "c_char_def" => true, - // LFS64 types have been removed in Emscripten 3.1.44 // https://github.com/emscripten-core/emscripten/pull/19812 t => t.ends_with("64") || t.ends_with("64_t"), @@ -3286,9 +3264,6 @@ fn test_neutrino(target: &str) { // Does not exist in Neutrino "locale_t" => true, - // `c_char_def` is always public but not always reexported. - "c_char_def" => true, - _ => false, } }); @@ -3455,8 +3430,6 @@ fn test_vxworks(target: &str) { // FIXME cfg.skip_type(move |ty| match ty { "stat64" | "sighandler_t" | "off64_t" => true, - // `c_char_def` is always public but not always reexported. - "c_char_def" => true, _ => false, }); @@ -3804,9 +3777,6 @@ fn test_linux(target: &str) { // FIXME: "'__uint128' undeclared" in C "__uint128" => true, - // `c_char_def` is always public but not always reexported. - "c_char_def" => true, - t => { if musl { // LFS64 types have been removed in musl 1.2.4+ @@ -4036,7 +4006,7 @@ fn test_linux(target: &str) { } // FIXME: Requires >= 5.4 kernel headers if name == "PTP_CLOCK_GETCAPS2" - || name == "PTP_ENABLE_PPS2" + || name == "PTP_ENABLE_PPS2" || name == "PTP_EXTTS_REQUEST2" || name == "PTP_PEROUT_REQUEST2" || name == "PTP_PIN_GETFUNC2" @@ -4759,8 +4729,6 @@ fn test_linux_like_apis(target: &str) { }) .skip_type(move |ty| match ty { "Elf64_Phdr" | "Elf32_Phdr" => false, - // `c_char_def` is always public but not always reexported. - "c_char_def" => true, _ => true, }); cfg.generate(src_hotfix_dir().join("lib.rs"), "linux_elf.rs"); @@ -4996,8 +4964,6 @@ fn test_haiku(target: &str) { "pthread_condattr_t" => true, "pthread_mutexattr_t" => true, "pthread_rwlockattr_t" => true, - // `c_char_def` is always public but not always reexported. - "c_char_def" => true, _ => false, } }); diff --git a/src/fuchsia/aarch64.rs b/src/fuchsia/aarch64.rs index b822375100948..577f0d99cf24d 100644 --- a/src/fuchsia/aarch64.rs +++ b/src/fuchsia/aarch64.rs @@ -1,7 +1,6 @@ use crate::off_t; use crate::prelude::*; -pub type c_char = u8; pub type __u64 = c_ulonglong; pub type wchar_t = u32; pub type nlink_t = c_ulong; diff --git a/src/fuchsia/riscv64.rs b/src/fuchsia/riscv64.rs index bed7a926030fe..c57d52aad1386 100644 --- a/src/fuchsia/riscv64.rs +++ b/src/fuchsia/riscv64.rs @@ -2,7 +2,6 @@ use crate::off_t; use crate::prelude::*; // From psABI Calling Convention for RV64 -pub type c_char = u8; pub type __u64 = c_ulonglong; pub type wchar_t = i32; diff --git a/src/fuchsia/x86_64.rs b/src/fuchsia/x86_64.rs index b82b86adcd41e..ffff3a78b5ed5 100644 --- a/src/fuchsia/x86_64.rs +++ b/src/fuchsia/x86_64.rs @@ -1,7 +1,6 @@ use crate::off_t; use crate::prelude::*; -pub type c_char = i8; pub type wchar_t = i32; pub type nlink_t = u64; pub type blksize_t = c_long; diff --git a/src/hermit.rs b/src/hermit.rs index 9363fed788304..03947bc01ade5 100644 --- a/src/hermit.rs +++ b/src/hermit.rs @@ -1,6 +1,5 @@ //! Hermit C type definitions -pub use crate::arch::c_char_def as c_char; use crate::prelude::*; pub type c_schar = i8; diff --git a/src/lib.rs b/src/lib.rs index 569775095fa8c..c1cdc7f1bc4eb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -41,41 +41,35 @@ cfg_if! { pub use core::ffi::c_void; -/// Type definitions that are coupled tighter to architecture than OS. -mod arch { - cfg_if! { - // This configuration comes from `rust-lang/rust` in `library/core/src/ffi/mod.rs`. - if #[cfg(all( - not(windows), - // FIXME(ctest): just use `target_vendor` = "apple"` once `ctest` supports it - not(any( - target_os = "macos", - target_os = "ios", - target_os = "tvos", - target_os = "watchos", - target_os = "visionos", - )), - any( - target_arch = "aarch64", - target_arch = "arm", - target_arch = "csky", - target_arch = "hexagon", - target_arch = "msp430", - target_arch = "powerpc", - target_arch = "powerpc64", - target_arch = "riscv64", - target_arch = "riscv32", - target_arch = "s390x", - target_arch = "xtensa", - ) - ))] { - // To be reexported as `c_char` - // FIXME(ctest): just name these `c_char` once `ctest` learns that these don't get - // exported. - pub type c_char_def = u8; - } else { - pub type c_char_def = i8; - } +cfg_if! { + // This configuration comes from `rust-lang/rust` in `library/core/src/ffi/mod.rs`. + if #[cfg(all( + not(windows), + // FIXME(ctest): just use `target_vendor` = "apple"` once `ctest` supports it + not(any( + target_os = "macos", + target_os = "ios", + target_os = "tvos", + target_os = "watchos", + target_os = "visionos", + )), + any( + target_arch = "aarch64", + target_arch = "arm", + target_arch = "csky", + target_arch = "hexagon", + target_arch = "msp430", + target_arch = "powerpc", + target_arch = "powerpc64", + target_arch = "riscv64", + target_arch = "riscv32", + target_arch = "s390x", + target_arch = "xtensa", + ) + ))] { + pub type c_char = u8; + } else { + pub type c_char = i8; } } diff --git a/src/sgx.rs b/src/sgx.rs index e37ccd79c3a55..65eded63ad460 100644 --- a/src/sgx.rs +++ b/src/sgx.rs @@ -19,7 +19,6 @@ pub type intptr_t = isize; pub type uintptr_t = usize; pub type ssize_t = isize; -pub type c_char = i8; pub type c_long = i64; pub type c_ulong = u64; diff --git a/src/solid/aarch64.rs b/src/solid/aarch64.rs index 4032488b6c0d5..630c7db54b55b 100644 --- a/src/solid/aarch64.rs +++ b/src/solid/aarch64.rs @@ -1,4 +1,3 @@ -pub type c_char = u8; pub type wchar_t = u32; pub type c_long = i64; pub type c_ulong = u64; diff --git a/src/solid/arm.rs b/src/solid/arm.rs index 55240068aa08e..01fc7262f03e2 100644 --- a/src/solid/arm.rs +++ b/src/solid/arm.rs @@ -1,4 +1,3 @@ -pub type c_char = u8; pub type wchar_t = u32; pub type c_long = i32; pub type c_ulong = u32; diff --git a/src/switch.rs b/src/switch.rs index 4a8b16e15f568..1875ea81ad1ec 100644 --- a/src/switch.rs +++ b/src/switch.rs @@ -20,7 +20,6 @@ pub type uintptr_t = usize; pub type ssize_t = isize; pub type off_t = i64; -pub type c_char = u8; pub type c_long = i64; pub type c_ulong = u64; pub type wchar_t = u32; diff --git a/src/teeos/mod.rs b/src/teeos/mod.rs index 40bc0c0549a08..b055d2aca8c7e 100644 --- a/src/teeos/mod.rs +++ b/src/teeos/mod.rs @@ -45,9 +45,6 @@ pub type ssize_t = isize; pub type pid_t = c_int; -// aarch64 specific -pub type c_char = u8; - pub type wchar_t = u32; pub type c_long = i64; diff --git a/src/trusty.rs b/src/trusty.rs index 676a456d892fe..db908d5c6d47a 100644 --- a/src/trusty.rs +++ b/src/trusty.rs @@ -1,4 +1,3 @@ -pub use crate::arch::c_char_def as c_char; use crate::prelude::*; pub type size_t = usize; pub type ssize_t = isize; diff --git a/src/unix/aix/mod.rs b/src/unix/aix/mod.rs index 6e98709dc5462..647836b6f6719 100644 --- a/src/unix/aix/mod.rs +++ b/src/unix/aix/mod.rs @@ -1,6 +1,5 @@ use crate::prelude::*; -pub type c_char = u8; pub type caddr_t = *mut c_char; pub type clockid_t = c_longlong; pub type blkcnt_t = c_long; diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 943d9e400ecc0..fe8bad4209f37 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -5,7 +5,6 @@ use crate::prelude::*; use crate::{cmsghdr, off_t}; -pub type c_char = i8; pub type wchar_t = i32; pub type clock_t = c_ulong; pub type time_t = c_long; diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs index db83835f12c94..2897ad377f14d 100644 --- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -2,7 +2,6 @@ use crate::prelude::*; use crate::{cmsghdr, off_t}; pub type dev_t = u32; -pub type c_char = i8; pub type wchar_t = i32; pub type clock_t = u64; pub type ino_t = u64; diff --git a/src/unix/bsd/freebsdlike/freebsd/aarch64.rs b/src/unix/bsd/freebsdlike/freebsd/aarch64.rs index 81d3eb351cdb6..0201008e485fb 100644 --- a/src/unix/bsd/freebsdlike/freebsd/aarch64.rs +++ b/src/unix/bsd/freebsdlike/freebsd/aarch64.rs @@ -1,6 +1,5 @@ use crate::prelude::*; -pub type c_char = u8; pub type c_long = i64; pub type c_ulong = u64; pub type clock_t = i32; diff --git a/src/unix/bsd/freebsdlike/freebsd/arm.rs b/src/unix/bsd/freebsdlike/freebsd/arm.rs index 07492c9333d75..1624e655a0f4c 100644 --- a/src/unix/bsd/freebsdlike/freebsd/arm.rs +++ b/src/unix/bsd/freebsdlike/freebsd/arm.rs @@ -1,6 +1,5 @@ use crate::prelude::*; -pub type c_char = u8; pub type c_long = i32; pub type c_ulong = u32; pub type clock_t = u32; diff --git a/src/unix/bsd/freebsdlike/freebsd/powerpc.rs b/src/unix/bsd/freebsdlike/freebsd/powerpc.rs index 0bd678c9821b6..6c8c973d570d1 100644 --- a/src/unix/bsd/freebsdlike/freebsd/powerpc.rs +++ b/src/unix/bsd/freebsdlike/freebsd/powerpc.rs @@ -1,6 +1,5 @@ use crate::prelude::*; -pub type c_char = u8; pub type c_long = i32; pub type c_ulong = u32; pub type clock_t = u32; diff --git a/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs b/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs index e1548a2fa4a09..a812568b38e7d 100644 --- a/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs +++ b/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs @@ -1,6 +1,5 @@ use crate::prelude::*; -pub type c_char = u8; pub type c_long = i64; pub type c_ulong = u64; pub type clock_t = u32; diff --git a/src/unix/bsd/freebsdlike/freebsd/riscv64.rs b/src/unix/bsd/freebsdlike/freebsd/riscv64.rs index e425411436d2b..212413cbe22af 100644 --- a/src/unix/bsd/freebsdlike/freebsd/riscv64.rs +++ b/src/unix/bsd/freebsdlike/freebsd/riscv64.rs @@ -1,6 +1,5 @@ use crate::prelude::*; -pub type c_char = u8; pub type c_long = i64; pub type c_ulong = u64; pub type clock_t = i32; diff --git a/src/unix/bsd/freebsdlike/freebsd/x86.rs b/src/unix/bsd/freebsdlike/freebsd/x86.rs index 5af53cd76f665..c5a922b455642 100644 --- a/src/unix/bsd/freebsdlike/freebsd/x86.rs +++ b/src/unix/bsd/freebsdlike/freebsd/x86.rs @@ -1,6 +1,5 @@ use crate::prelude::*; -pub type c_char = i8; pub type c_long = i32; pub type c_ulong = u32; pub type clock_t = c_ulong; diff --git a/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs b/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs index fca9a126f81c1..199ea643fdab4 100644 --- a/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs @@ -1,6 +1,5 @@ use crate::prelude::*; -pub type c_char = i8; pub type c_long = i64; pub type c_ulong = u64; pub type clock_t = i32; diff --git a/src/unix/bsd/netbsdlike/netbsd/aarch64.rs b/src/unix/bsd/netbsdlike/netbsd/aarch64.rs index 2391801fe458b..dbac03d2fb2ac 100644 --- a/src/unix/bsd/netbsdlike/netbsd/aarch64.rs +++ b/src/unix/bsd/netbsdlike/netbsd/aarch64.rs @@ -3,7 +3,6 @@ use crate::PT_FIRSTMACH; pub type c_long = i64; pub type c_ulong = u64; -pub type c_char = u8; pub type greg_t = u64; pub type __cpu_simple_lock_nv_t = c_uchar; diff --git a/src/unix/bsd/netbsdlike/netbsd/arm.rs b/src/unix/bsd/netbsdlike/netbsd/arm.rs index 1f54c8135bf47..698eba93b31a5 100644 --- a/src/unix/bsd/netbsdlike/netbsd/arm.rs +++ b/src/unix/bsd/netbsdlike/netbsd/arm.rs @@ -3,7 +3,6 @@ use crate::PT_FIRSTMACH; pub type c_long = i32; pub type c_ulong = u32; -pub type c_char = u8; pub type __cpu_simple_lock_nv_t = c_int; pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; diff --git a/src/unix/bsd/netbsdlike/netbsd/mips.rs b/src/unix/bsd/netbsdlike/netbsd/mips.rs index 7129c0f54eb6f..028deb0cfbf76 100644 --- a/src/unix/bsd/netbsdlike/netbsd/mips.rs +++ b/src/unix/bsd/netbsdlike/netbsd/mips.rs @@ -3,7 +3,6 @@ use crate::PT_FIRSTMACH; pub type c_long = i32; pub type c_ulong = u32; -pub type c_char = i8; pub type __cpu_simple_lock_nv_t = c_int; pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; diff --git a/src/unix/bsd/netbsdlike/netbsd/powerpc.rs b/src/unix/bsd/netbsdlike/netbsd/powerpc.rs index a086396ed610a..20eba6849a3ee 100644 --- a/src/unix/bsd/netbsdlike/netbsd/powerpc.rs +++ b/src/unix/bsd/netbsdlike/netbsd/powerpc.rs @@ -3,7 +3,6 @@ use crate::PT_FIRSTMACH; pub type c_long = i32; pub type c_ulong = u32; -pub type c_char = u8; pub type __cpu_simple_lock_nv_t = c_int; pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; diff --git a/src/unix/bsd/netbsdlike/netbsd/riscv64.rs b/src/unix/bsd/netbsdlike/netbsd/riscv64.rs index 68cd264aadb78..0437b994ca276 100644 --- a/src/unix/bsd/netbsdlike/netbsd/riscv64.rs +++ b/src/unix/bsd/netbsdlike/netbsd/riscv64.rs @@ -4,7 +4,6 @@ use crate::prelude::*; pub type c_long = i64; pub type c_ulong = u64; -pub type c_char = u8; pub type __greg_t = u64; pub type __cpu_simple_lock_nv_t = c_int; pub type __gregset = [__greg_t; _NGREG]; diff --git a/src/unix/bsd/netbsdlike/netbsd/sparc64.rs b/src/unix/bsd/netbsdlike/netbsd/sparc64.rs index d564f58a3e688..3cfe535e7edfa 100644 --- a/src/unix/bsd/netbsdlike/netbsd/sparc64.rs +++ b/src/unix/bsd/netbsdlike/netbsd/sparc64.rs @@ -2,7 +2,6 @@ use crate::prelude::*; pub type c_long = i64; pub type c_ulong = u64; -pub type c_char = i8; pub type __cpu_simple_lock_nv_t = c_uchar; // should be pub(crate), but that requires Rust 1.18.0 diff --git a/src/unix/bsd/netbsdlike/netbsd/x86.rs b/src/unix/bsd/netbsdlike/netbsd/x86.rs index 3c55792defcbd..04741f2dc1f4e 100644 --- a/src/unix/bsd/netbsdlike/netbsd/x86.rs +++ b/src/unix/bsd/netbsdlike/netbsd/x86.rs @@ -2,7 +2,6 @@ use crate::prelude::*; pub type c_long = i32; pub type c_ulong = u32; -pub type c_char = i8; pub type __cpu_simple_lock_nv_t = c_uchar; pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; diff --git a/src/unix/bsd/netbsdlike/netbsd/x86_64.rs b/src/unix/bsd/netbsdlike/netbsd/x86_64.rs index f968e36d67aa2..52f3da771a157 100644 --- a/src/unix/bsd/netbsdlike/netbsd/x86_64.rs +++ b/src/unix/bsd/netbsdlike/netbsd/x86_64.rs @@ -3,7 +3,6 @@ use crate::PT_FIRSTMACH; pub type c_long = i64; pub type c_ulong = u64; -pub type c_char = i8; pub type c___greg_t = u64; pub type __cpu_simple_lock_nv_t = c_uchar; diff --git a/src/unix/bsd/netbsdlike/openbsd/aarch64.rs b/src/unix/bsd/netbsdlike/openbsd/aarch64.rs index bf704757c59d6..4cd0b32549835 100644 --- a/src/unix/bsd/netbsdlike/openbsd/aarch64.rs +++ b/src/unix/bsd/netbsdlike/openbsd/aarch64.rs @@ -2,7 +2,6 @@ use crate::prelude::*; pub type c_long = i64; pub type c_ulong = u64; -pub type c_char = u8; pub type ucontext_t = sigcontext; s! { diff --git a/src/unix/bsd/netbsdlike/openbsd/arm.rs b/src/unix/bsd/netbsdlike/openbsd/arm.rs index 1e66ed247a2eb..7fd17cf65a55f 100644 --- a/src/unix/bsd/netbsdlike/openbsd/arm.rs +++ b/src/unix/bsd/netbsdlike/openbsd/arm.rs @@ -2,7 +2,6 @@ use crate::prelude::*; pub type c_long = i32; pub type c_ulong = u32; -pub type c_char = u8; pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; diff --git a/src/unix/bsd/netbsdlike/openbsd/mips64.rs b/src/unix/bsd/netbsdlike/openbsd/mips64.rs index 15803ced09a08..17ebae2889f17 100644 --- a/src/unix/bsd/netbsdlike/openbsd/mips64.rs +++ b/src/unix/bsd/netbsdlike/openbsd/mips64.rs @@ -1,6 +1,5 @@ pub type c_long = i64; pub type c_ulong = u64; -pub type c_char = i8; #[doc(hidden)] pub const _ALIGNBYTES: usize = 7; diff --git a/src/unix/bsd/netbsdlike/openbsd/powerpc.rs b/src/unix/bsd/netbsdlike/openbsd/powerpc.rs index 1e66ed247a2eb..7fd17cf65a55f 100644 --- a/src/unix/bsd/netbsdlike/openbsd/powerpc.rs +++ b/src/unix/bsd/netbsdlike/openbsd/powerpc.rs @@ -2,7 +2,6 @@ use crate::prelude::*; pub type c_long = i32; pub type c_ulong = u32; -pub type c_char = u8; pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; diff --git a/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs b/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs index cb808719fb8ea..1a3b452091ce0 100644 --- a/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs +++ b/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs @@ -2,7 +2,6 @@ use crate::prelude::*; pub type c_long = i64; pub type c_ulong = u64; -pub type c_char = u8; pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; diff --git a/src/unix/bsd/netbsdlike/openbsd/riscv64.rs b/src/unix/bsd/netbsdlike/openbsd/riscv64.rs index 6a39f3494dd14..d37e9a67e6888 100644 --- a/src/unix/bsd/netbsdlike/openbsd/riscv64.rs +++ b/src/unix/bsd/netbsdlike/openbsd/riscv64.rs @@ -2,7 +2,6 @@ use crate::prelude::*; pub type c_long = i64; pub type c_ulong = u64; -pub type c_char = u8; pub type ucontext_t = sigcontext; s! { diff --git a/src/unix/bsd/netbsdlike/openbsd/sparc64.rs b/src/unix/bsd/netbsdlike/openbsd/sparc64.rs index 070fc9385f6c9..f8e165a7de299 100644 --- a/src/unix/bsd/netbsdlike/openbsd/sparc64.rs +++ b/src/unix/bsd/netbsdlike/openbsd/sparc64.rs @@ -1,6 +1,5 @@ pub type c_long = i64; pub type c_ulong = u64; -pub type c_char = i8; #[doc(hidden)] pub const _ALIGNBYTES: usize = 0xf; diff --git a/src/unix/bsd/netbsdlike/openbsd/x86.rs b/src/unix/bsd/netbsdlike/openbsd/x86.rs index 4b495d0c16de8..cac4ea7f8e94c 100644 --- a/src/unix/bsd/netbsdlike/openbsd/x86.rs +++ b/src/unix/bsd/netbsdlike/openbsd/x86.rs @@ -2,7 +2,6 @@ use crate::prelude::*; pub type c_long = i32; pub type c_ulong = u32; -pub type c_char = i8; pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; diff --git a/src/unix/bsd/netbsdlike/openbsd/x86_64.rs b/src/unix/bsd/netbsdlike/openbsd/x86_64.rs index 4380c1d118922..683046836320d 100644 --- a/src/unix/bsd/netbsdlike/openbsd/x86_64.rs +++ b/src/unix/bsd/netbsdlike/openbsd/x86_64.rs @@ -3,7 +3,6 @@ use crate::PT_FIRSTMACH; pub type c_long = i64; pub type c_ulong = u64; -pub type c_char = i8; pub type ucontext_t = sigcontext; s! { diff --git a/src/unix/haiku/mod.rs b/src/unix/haiku/mod.rs index 78477a10bfc51..10ee719b9c18f 100644 --- a/src/unix/haiku/mod.rs +++ b/src/unix/haiku/mod.rs @@ -6,7 +6,6 @@ pub type pthread_key_t = c_int; pub type nfds_t = c_ulong; pub type tcflag_t = c_uint; pub type speed_t = c_uchar; -pub type c_char = i8; pub type clock_t = i32; pub type clockid_t = i32; pub type suseconds_t = i32; diff --git a/src/unix/hurd/mod.rs b/src/unix/hurd/mod.rs index 1a04a725ada56..3a9253fc31f51 100644 --- a/src/unix/hurd/mod.rs +++ b/src/unix/hurd/mod.rs @@ -4,8 +4,6 @@ use crate::c_schar; use crate::prelude::*; // types -pub type c_char = i8; - pub type __s16_type = c_short; pub type __u16_type = c_ushort; pub type __s32_type = c_int; diff --git a/src/unix/linux_like/android/b32/arm.rs b/src/unix/linux_like/android/b32/arm.rs index 0bf4087fde751..a6170adc14d3f 100644 --- a/src/unix/linux_like/android/b32/arm.rs +++ b/src/unix/linux_like/android/b32/arm.rs @@ -1,6 +1,5 @@ use crate::prelude::*; -pub type c_char = u8; pub type wchar_t = u32; pub type greg_t = i32; pub type mcontext_t = sigcontext; diff --git a/src/unix/linux_like/android/b32/x86/mod.rs b/src/unix/linux_like/android/b32/x86/mod.rs index 9f80d8a71f449..a5560e051660a 100644 --- a/src/unix/linux_like/android/b32/x86/mod.rs +++ b/src/unix/linux_like/android/b32/x86/mod.rs @@ -1,6 +1,5 @@ use crate::prelude::*; -pub type c_char = i8; pub type wchar_t = i32; pub type greg_t = i32; diff --git a/src/unix/linux_like/android/b64/aarch64/mod.rs b/src/unix/linux_like/android/b64/aarch64/mod.rs index 39d8bc07c4dd5..b678eb8da6aa4 100644 --- a/src/unix/linux_like/android/b64/aarch64/mod.rs +++ b/src/unix/linux_like/android/b64/aarch64/mod.rs @@ -1,7 +1,6 @@ use crate::off64_t; use crate::prelude::*; -pub type c_char = u8; pub type wchar_t = u32; pub type __u64 = c_ulonglong; pub type __s64 = c_longlong; diff --git a/src/unix/linux_like/android/b64/riscv64/mod.rs b/src/unix/linux_like/android/b64/riscv64/mod.rs index d35c408955109..c4dc98e010aed 100644 --- a/src/unix/linux_like/android/b64/riscv64/mod.rs +++ b/src/unix/linux_like/android/b64/riscv64/mod.rs @@ -1,7 +1,6 @@ use crate::off64_t; use crate::prelude::*; -pub type c_char = u8; pub type wchar_t = u32; pub type greg_t = i64; pub type __u64 = c_ulonglong; diff --git a/src/unix/linux_like/android/b64/x86_64/mod.rs b/src/unix/linux_like/android/b64/x86_64/mod.rs index 4da5cd4995679..ad878462c8c1a 100644 --- a/src/unix/linux_like/android/b64/x86_64/mod.rs +++ b/src/unix/linux_like/android/b64/x86_64/mod.rs @@ -1,7 +1,6 @@ use crate::off64_t; use crate::prelude::*; -pub type c_char = i8; pub type wchar_t = i32; pub type greg_t = i64; pub type __u64 = c_ulonglong; diff --git a/src/unix/linux_like/emscripten/mod.rs b/src/unix/linux_like/emscripten/mod.rs index 866a20cd00722..c51935ee99f96 100644 --- a/src/unix/linux_like/emscripten/mod.rs +++ b/src/unix/linux_like/emscripten/mod.rs @@ -1,6 +1,5 @@ use crate::prelude::*; -pub type c_char = i8; pub type wchar_t = i32; pub type useconds_t = u32; pub type dev_t = u32; diff --git a/src/unix/linux_like/linux/gnu/b32/arm/mod.rs b/src/unix/linux_like/linux/gnu/b32/arm/mod.rs index f3869723996cb..9462f627d63e7 100644 --- a/src/unix/linux_like/linux/gnu/b32/arm/mod.rs +++ b/src/unix/linux_like/linux/gnu/b32/arm/mod.rs @@ -1,7 +1,6 @@ use crate::prelude::*; use crate::{off64_t, off_t}; -pub type c_char = u8; pub type wchar_t = u32; s! { diff --git a/src/unix/linux_like/linux/gnu/b32/csky/mod.rs b/src/unix/linux_like/linux/gnu/b32/csky/mod.rs index eb6f70d8fed07..96cc52c55854e 100644 --- a/src/unix/linux_like/linux/gnu/b32/csky/mod.rs +++ b/src/unix/linux_like/linux/gnu/b32/csky/mod.rs @@ -1,7 +1,6 @@ use crate::prelude::*; use crate::{off64_t, off_t}; -pub type c_char = u8; pub type wchar_t = u32; s! { diff --git a/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs b/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs index 3d252c6253035..2de54f047bbb4 100644 --- a/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs +++ b/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs @@ -1,7 +1,6 @@ use crate::prelude::*; use crate::{off64_t, off_t}; -pub type c_char = i8; pub type wchar_t = i32; s! { diff --git a/src/unix/linux_like/linux/gnu/b32/mips/mod.rs b/src/unix/linux_like/linux/gnu/b32/mips/mod.rs index 73da7739dabf5..9fd8f819379e5 100644 --- a/src/unix/linux_like/linux/gnu/b32/mips/mod.rs +++ b/src/unix/linux_like/linux/gnu/b32/mips/mod.rs @@ -1,7 +1,6 @@ use crate::prelude::*; use crate::{off64_t, off_t}; -pub type c_char = i8; pub type wchar_t = i32; s! { diff --git a/src/unix/linux_like/linux/gnu/b32/powerpc.rs b/src/unix/linux_like/linux/gnu/b32/powerpc.rs index 75ec2385a1230..025ae37002e35 100644 --- a/src/unix/linux_like/linux/gnu/b32/powerpc.rs +++ b/src/unix/linux_like/linux/gnu/b32/powerpc.rs @@ -1,7 +1,6 @@ use crate::prelude::*; use crate::{off64_t, off_t}; -pub type c_char = u8; pub type wchar_t = i32; s! { diff --git a/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs b/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs index 43547cc7ad868..91b17847e10ae 100644 --- a/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs +++ b/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs @@ -3,7 +3,6 @@ use crate::prelude::*; use crate::{off64_t, off_t}; -pub type c_char = u8; pub type wchar_t = c_int; s! { diff --git a/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs b/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs index cfe62018f5fdd..fcd3c52bcee37 100644 --- a/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs +++ b/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs @@ -3,7 +3,6 @@ use crate::prelude::*; use crate::{off64_t, off_t}; -pub type c_char = i8; pub type wchar_t = i32; s! { diff --git a/src/unix/linux_like/linux/gnu/b32/x86/mod.rs b/src/unix/linux_like/linux/gnu/b32/x86/mod.rs index d626236dda792..84fb3ae31e6c9 100644 --- a/src/unix/linux_like/linux/gnu/b32/x86/mod.rs +++ b/src/unix/linux_like/linux/gnu/b32/x86/mod.rs @@ -1,7 +1,6 @@ use crate::prelude::*; use crate::{off64_t, off_t}; -pub type c_char = i8; pub type wchar_t = i32; pub type greg_t = i32; diff --git a/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs b/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs index 27ba5263c5361..a4df172b8f5f7 100644 --- a/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs +++ b/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs @@ -3,7 +3,6 @@ use crate::prelude::*; use crate::{off64_t, off_t}; -pub type c_char = u8; pub type wchar_t = u32; pub type nlink_t = u32; pub type blksize_t = i32; diff --git a/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs b/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs index 8c05659dc09a7..e8f045ba5f83b 100644 --- a/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs +++ b/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs @@ -1,7 +1,6 @@ use crate::prelude::*; use crate::{off64_t, off_t, pthread_mutex_t}; -pub type c_char = i8; pub type c_long = i64; pub type c_ulong = u64; pub type wchar_t = i32; diff --git a/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs b/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs index 2d85df1385a10..e1aef3759ddd5 100644 --- a/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs +++ b/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs @@ -2,7 +2,6 @@ use crate::prelude::*; use crate::{off64_t, off_t, pthread_mutex_t}; pub type blksize_t = i64; -pub type c_char = i8; pub type c_long = i64; pub type c_ulong = u64; pub type nlink_t = u64; diff --git a/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs b/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs index 86d047dbf3878..8d79845eb401b 100644 --- a/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs +++ b/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs @@ -5,7 +5,6 @@ use crate::{off64_t, off_t, pthread_mutex_t}; pub type c_long = i64; pub type c_ulong = u64; -pub type c_char = u8; pub type wchar_t = i32; pub type nlink_t = u64; pub type blksize_t = i64; diff --git a/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs b/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs index db8deafe896be..3dd9369457353 100644 --- a/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs +++ b/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs @@ -3,7 +3,6 @@ use crate::prelude::*; use crate::{off64_t, off_t}; -pub type c_char = u8; pub type c_long = i64; pub type c_ulong = u64; pub type wchar_t = c_int; diff --git a/src/unix/linux_like/linux/gnu/b64/s390x.rs b/src/unix/linux_like/linux/gnu/b64/s390x.rs index 95dacc9f91cbd..d5ab89a86fc3c 100644 --- a/src/unix/linux_like/linux/gnu/b64/s390x.rs +++ b/src/unix/linux_like/linux/gnu/b64/s390x.rs @@ -4,7 +4,6 @@ use crate::prelude::*; use crate::{off64_t, off_t, pthread_mutex_t}; pub type blksize_t = i64; -pub type c_char = u8; pub type c_long = i64; pub type c_ulong = u64; pub type nlink_t = u64; diff --git a/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs b/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs index 5626cd3e46933..b9f9485de1e37 100644 --- a/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs +++ b/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs @@ -5,7 +5,6 @@ use crate::{off64_t, off_t, pthread_mutex_t}; pub type c_long = i64; pub type c_ulong = u64; -pub type c_char = i8; pub type wchar_t = i32; pub type nlink_t = u32; pub type blksize_t = i64; diff --git a/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs b/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs index 0d9971252391b..a0dbb99ed76d9 100644 --- a/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs +++ b/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs @@ -3,7 +3,6 @@ use crate::prelude::*; use crate::{off64_t, off_t}; -pub type c_char = i8; pub type wchar_t = i32; pub type nlink_t = u64; pub type blksize_t = i64; diff --git a/src/unix/linux_like/linux/musl/b32/arm/mod.rs b/src/unix/linux_like/linux/musl/b32/arm/mod.rs index 3116837322b60..5829b0270d69c 100644 --- a/src/unix/linux_like/linux/musl/b32/arm/mod.rs +++ b/src/unix/linux_like/linux/musl/b32/arm/mod.rs @@ -1,7 +1,6 @@ use crate::off_t; use crate::prelude::*; -pub type c_char = u8; pub type wchar_t = u32; s! { diff --git a/src/unix/linux_like/linux/musl/b32/hexagon.rs b/src/unix/linux_like/linux/musl/b32/hexagon.rs index 9becabd146f8d..61174fbd408da 100644 --- a/src/unix/linux_like/linux/musl/b32/hexagon.rs +++ b/src/unix/linux_like/linux/musl/b32/hexagon.rs @@ -1,6 +1,5 @@ use crate::prelude::*; -pub type c_char = u8; pub type wchar_t = u32; pub type stat64 = crate::stat; diff --git a/src/unix/linux_like/linux/musl/b32/mips/mod.rs b/src/unix/linux_like/linux/musl/b32/mips/mod.rs index aacdc44579496..56418ededd38e 100644 --- a/src/unix/linux_like/linux/musl/b32/mips/mod.rs +++ b/src/unix/linux_like/linux/musl/b32/mips/mod.rs @@ -1,7 +1,6 @@ use crate::off_t; use crate::prelude::*; -pub type c_char = i8; pub type wchar_t = c_int; s! { diff --git a/src/unix/linux_like/linux/musl/b32/powerpc.rs b/src/unix/linux_like/linux/musl/b32/powerpc.rs index 29e797959123d..de2c5d5e3f724 100644 --- a/src/unix/linux_like/linux/musl/b32/powerpc.rs +++ b/src/unix/linux_like/linux/musl/b32/powerpc.rs @@ -1,7 +1,6 @@ use crate::off_t; use crate::prelude::*; -pub type c_char = u8; pub type wchar_t = i32; s! { diff --git a/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs b/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs index ff5839c64bc42..291dc7ec644d0 100644 --- a/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs +++ b/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs @@ -3,7 +3,6 @@ use crate::prelude::*; use crate::{off64_t, off_t}; -pub type c_char = u8; pub type wchar_t = c_int; s! { diff --git a/src/unix/linux_like/linux/musl/b32/x86/mod.rs b/src/unix/linux_like/linux/musl/b32/x86/mod.rs index 476bacdb6b88d..5b947f38d99f2 100644 --- a/src/unix/linux_like/linux/musl/b32/x86/mod.rs +++ b/src/unix/linux_like/linux/musl/b32/x86/mod.rs @@ -1,7 +1,6 @@ use crate::off_t; use crate::prelude::*; -pub type c_char = i8; pub type wchar_t = i32; s! { diff --git a/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs b/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs index c660ec5c3453f..e84b9f563c668 100644 --- a/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs +++ b/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs @@ -1,7 +1,6 @@ use crate::off_t; use crate::prelude::*; -pub type c_char = u8; pub type __u64 = c_ulonglong; pub type __s64 = c_longlong; pub type wchar_t = u32; diff --git a/src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs b/src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs index 1be59ada9aad5..36f05e10e6ea4 100644 --- a/src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs +++ b/src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs @@ -3,7 +3,6 @@ use crate::prelude::*; use crate::{off64_t, off_t}; -pub type c_char = i8; pub type wchar_t = c_int; pub type nlink_t = c_uint; diff --git a/src/unix/linux_like/linux/musl/b64/mips64.rs b/src/unix/linux_like/linux/musl/b64/mips64.rs index 09191a5f8275c..0ce7e932a2db4 100644 --- a/src/unix/linux_like/linux/musl/b64/mips64.rs +++ b/src/unix/linux_like/linux/musl/b64/mips64.rs @@ -1,7 +1,6 @@ use crate::off_t; use crate::prelude::*; -pub type c_char = i8; pub type wchar_t = i32; pub type __u64 = c_ulong; pub type __s64 = c_long; diff --git a/src/unix/linux_like/linux/musl/b64/powerpc64.rs b/src/unix/linux_like/linux/musl/b64/powerpc64.rs index 3753293c8e0cf..f85e2748b1848 100644 --- a/src/unix/linux_like/linux/musl/b64/powerpc64.rs +++ b/src/unix/linux_like/linux/musl/b64/powerpc64.rs @@ -1,7 +1,6 @@ use crate::off_t; use crate::prelude::*; -pub type c_char = u8; pub type wchar_t = i32; pub type __u64 = c_ulong; pub type __s64 = c_long; diff --git a/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs b/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs index ec0ba4c1f926f..2b9b394d51d17 100644 --- a/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs +++ b/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs @@ -3,7 +3,6 @@ use crate::prelude::*; use crate::{off64_t, off_t}; -pub type c_char = u8; pub type wchar_t = c_int; pub type nlink_t = c_uint; diff --git a/src/unix/linux_like/linux/musl/b64/s390x.rs b/src/unix/linux_like/linux/musl/b64/s390x.rs index 22a6cec4185f0..25f49fc15534d 100644 --- a/src/unix/linux_like/linux/musl/b64/s390x.rs +++ b/src/unix/linux_like/linux/musl/b64/s390x.rs @@ -2,7 +2,6 @@ use crate::off_t; use crate::prelude::*; pub type blksize_t = i64; -pub type c_char = u8; pub type nlink_t = u64; pub type wchar_t = i32; pub type greg_t = u64; diff --git a/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs b/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs index 6399f33209ac2..b8f659b72392d 100644 --- a/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs +++ b/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs @@ -1,7 +1,6 @@ use crate::off_t; use crate::prelude::*; -pub type c_char = i8; pub type wchar_t = i32; pub type nlink_t = u64; pub type blksize_t = c_long; diff --git a/src/unix/linux_like/linux/uclibc/arm/mod.rs b/src/unix/linux_like/linux/uclibc/arm/mod.rs index da3203f98a3de..cbeedb51630f4 100644 --- a/src/unix/linux_like/linux/uclibc/arm/mod.rs +++ b/src/unix/linux_like/linux/uclibc/arm/mod.rs @@ -1,7 +1,6 @@ use crate::off64_t; use crate::prelude::*; -pub type c_char = u8; pub type wchar_t = c_uint; pub type c_long = i32; pub type c_ulong = u32; diff --git a/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs b/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs index 6118928312b91..049b987fcd98a 100644 --- a/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs +++ b/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs @@ -1,7 +1,6 @@ use crate::off64_t; use crate::prelude::*; -pub type c_char = i8; pub type c_long = i32; pub type c_ulong = u32; pub type clock_t = i32; diff --git a/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs b/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs index 86ee7bdff472b..d0a0f345546b6 100644 --- a/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs +++ b/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs @@ -3,7 +3,6 @@ use crate::prelude::*; pub type blkcnt_t = i64; pub type blksize_t = i64; -pub type c_char = i8; pub type c_long = i64; pub type c_ulong = u64; pub type fsblkcnt_t = c_ulong; diff --git a/src/unix/linux_like/linux/uclibc/x86_64/mod.rs b/src/unix/linux_like/linux/uclibc/x86_64/mod.rs index 709b0d152444a..8a363d558257f 100644 --- a/src/unix/linux_like/linux/uclibc/x86_64/mod.rs +++ b/src/unix/linux_like/linux/uclibc/x86_64/mod.rs @@ -6,7 +6,6 @@ use crate::prelude::*; pub type blkcnt_t = i64; pub type blksize_t = i64; pub type clock_t = i64; -pub type c_char = i8; pub type c_long = i64; pub type c_ulong = u64; pub type fsblkcnt_t = c_ulong; diff --git a/src/unix/newlib/aarch64/mod.rs b/src/unix/newlib/aarch64/mod.rs index 0aa1de7dcc828..f0ab09443da22 100644 --- a/src/unix/newlib/aarch64/mod.rs +++ b/src/unix/newlib/aarch64/mod.rs @@ -1,7 +1,6 @@ use crate::prelude::*; pub type clock_t = c_long; -pub type c_char = u8; pub type wchar_t = u32; pub type c_long = i64; diff --git a/src/unix/newlib/arm/mod.rs b/src/unix/newlib/arm/mod.rs index a32e37ede596a..ae89440f237db 100644 --- a/src/unix/newlib/arm/mod.rs +++ b/src/unix/newlib/arm/mod.rs @@ -1,7 +1,6 @@ use crate::prelude::*; pub type clock_t = c_long; -pub type c_char = u8; pub type wchar_t = u32; pub type c_long = i32; diff --git a/src/unix/newlib/espidf/mod.rs b/src/unix/newlib/espidf/mod.rs index 1ac5113c917b5..0bb8e3ae9c766 100644 --- a/src/unix/newlib/espidf/mod.rs +++ b/src/unix/newlib/espidf/mod.rs @@ -1,7 +1,6 @@ use crate::prelude::*; pub type clock_t = c_ulong; -pub type c_char = u8; pub type wchar_t = u32; pub type c_long = i32; diff --git a/src/unix/newlib/horizon/mod.rs b/src/unix/newlib/horizon/mod.rs index 8c662f2a4517a..05a1b284e295d 100644 --- a/src/unix/newlib/horizon/mod.rs +++ b/src/unix/newlib/horizon/mod.rs @@ -3,7 +3,6 @@ use crate::off_t; use crate::prelude::*; -pub type c_char = u8; pub type c_long = i32; pub type c_ulong = u32; diff --git a/src/unix/newlib/powerpc/mod.rs b/src/unix/newlib/powerpc/mod.rs index 6a9c42bdb7228..b53c832a71aed 100644 --- a/src/unix/newlib/powerpc/mod.rs +++ b/src/unix/newlib/powerpc/mod.rs @@ -1,7 +1,6 @@ use crate::prelude::*; pub type clock_t = c_ulong; -pub type c_char = u8; pub type wchar_t = c_int; pub type c_long = i32; diff --git a/src/unix/newlib/vita/mod.rs b/src/unix/newlib/vita/mod.rs index 1a8c89319fa2d..1f531cb4d35ff 100644 --- a/src/unix/newlib/vita/mod.rs +++ b/src/unix/newlib/vita/mod.rs @@ -3,7 +3,6 @@ use crate::prelude::*; pub type clock_t = c_long; -pub type c_char = u8; pub type wchar_t = u32; pub type c_long = i32; diff --git a/src/unix/nto/aarch64.rs b/src/unix/nto/aarch64.rs index d0987f28be6b2..acc36bbf75363 100644 --- a/src/unix/nto/aarch64.rs +++ b/src/unix/nto/aarch64.rs @@ -1,6 +1,5 @@ use crate::prelude::*; -pub type c_char = u8; pub type wchar_t = u32; pub type c_long = i64; pub type c_ulong = u64; diff --git a/src/unix/nto/x86_64.rs b/src/unix/nto/x86_64.rs index 425f479949466..6cd24e187c443 100644 --- a/src/unix/nto/x86_64.rs +++ b/src/unix/nto/x86_64.rs @@ -1,6 +1,5 @@ use crate::prelude::*; -pub type c_char = i8; pub type wchar_t = u32; pub type c_long = i64; pub type c_ulong = u64; diff --git a/src/unix/nuttx/mod.rs b/src/unix/nuttx/mod.rs index ed3e1ed8bfa34..bf6efdd7ae362 100644 --- a/src/unix/nuttx/mod.rs +++ b/src/unix/nuttx/mod.rs @@ -1,4 +1,3 @@ -pub use crate::arch::c_char_def as c_char; use crate::prelude::*; use crate::{in6_addr, in_addr_t, timespec, DIR}; diff --git a/src/unix/redox/mod.rs b/src/unix/redox/mod.rs index c557509224437..7b918494c72c8 100644 --- a/src/unix/redox/mod.rs +++ b/src/unix/redox/mod.rs @@ -1,4 +1,3 @@ -pub use crate::arch::c_char_def as c_char; use crate::prelude::*; pub type wchar_t = i32; diff --git a/src/unix/solarish/mod.rs b/src/unix/solarish/mod.rs index 0f398ca448263..9def117803e52 100644 --- a/src/unix/solarish/mod.rs +++ b/src/unix/solarish/mod.rs @@ -1,6 +1,5 @@ use core::mem::size_of; -pub use crate::arch::c_char_def as c_char; use crate::prelude::*; pub type c_long = i64; diff --git a/src/vxworks/aarch64.rs b/src/vxworks/aarch64.rs index 4032488b6c0d5..630c7db54b55b 100644 --- a/src/vxworks/aarch64.rs +++ b/src/vxworks/aarch64.rs @@ -1,4 +1,3 @@ -pub type c_char = u8; pub type wchar_t = u32; pub type c_long = i64; pub type c_ulong = u64; diff --git a/src/vxworks/arm.rs b/src/vxworks/arm.rs index 55240068aa08e..01fc7262f03e2 100644 --- a/src/vxworks/arm.rs +++ b/src/vxworks/arm.rs @@ -1,4 +1,3 @@ -pub type c_char = u8; pub type wchar_t = u32; pub type c_long = i32; pub type c_ulong = u32; diff --git a/src/vxworks/powerpc.rs b/src/vxworks/powerpc.rs index 55240068aa08e..01fc7262f03e2 100644 --- a/src/vxworks/powerpc.rs +++ b/src/vxworks/powerpc.rs @@ -1,4 +1,3 @@ -pub type c_char = u8; pub type wchar_t = u32; pub type c_long = i32; pub type c_ulong = u32; diff --git a/src/vxworks/powerpc64.rs b/src/vxworks/powerpc64.rs index 4032488b6c0d5..630c7db54b55b 100644 --- a/src/vxworks/powerpc64.rs +++ b/src/vxworks/powerpc64.rs @@ -1,4 +1,3 @@ -pub type c_char = u8; pub type wchar_t = u32; pub type c_long = i64; pub type c_ulong = u64; diff --git a/src/vxworks/riscv32.rs b/src/vxworks/riscv32.rs index 40a8e338e83a2..741e312afce17 100644 --- a/src/vxworks/riscv32.rs +++ b/src/vxworks/riscv32.rs @@ -1,4 +1,3 @@ -pub type c_char = u8; pub type wchar_t = i32; pub type c_long = i32; pub type c_ulong = u32; diff --git a/src/vxworks/riscv64.rs b/src/vxworks/riscv64.rs index ccd68b0c64f82..7bacd5c5abec4 100644 --- a/src/vxworks/riscv64.rs +++ b/src/vxworks/riscv64.rs @@ -1,4 +1,3 @@ -pub type c_char = u8; pub type wchar_t = i32; pub type c_long = i64; pub type c_ulong = u64; diff --git a/src/vxworks/x86.rs b/src/vxworks/x86.rs index e617bb83c6ce3..741e312afce17 100644 --- a/src/vxworks/x86.rs +++ b/src/vxworks/x86.rs @@ -1,4 +1,3 @@ -pub type c_char = i8; pub type wchar_t = i32; pub type c_long = i32; pub type c_ulong = u32; diff --git a/src/vxworks/x86_64.rs b/src/vxworks/x86_64.rs index 5e95ea2567ddf..7bacd5c5abec4 100644 --- a/src/vxworks/x86_64.rs +++ b/src/vxworks/x86_64.rs @@ -1,4 +1,3 @@ -pub type c_char = i8; pub type wchar_t = i32; pub type c_long = i64; pub type c_ulong = u64; diff --git a/src/wasi/mod.rs b/src/wasi/mod.rs index 5919d43b857b8..909b33a20ac77 100644 --- a/src/wasi/mod.rs +++ b/src/wasi/mod.rs @@ -7,7 +7,6 @@ use core::iter::Iterator; use crate::prelude::*; -pub type c_char = i8; pub type c_uchar = u8; pub type c_schar = i8; pub type c_int = i32; diff --git a/src/windows/mod.rs b/src/windows/mod.rs index 927f01f409785..6e343db53f022 100644 --- a/src/windows/mod.rs +++ b/src/windows/mod.rs @@ -22,7 +22,6 @@ pub type uintptr_t = usize; pub type ssize_t = isize; pub type sighandler_t = usize; -pub type c_char = i8; pub type c_long = i32; pub type c_ulong = u32; pub type wchar_t = u16; diff --git a/src/xous.rs b/src/xous.rs index 4073349306fb9..468865c8d4131 100644 --- a/src/xous.rs +++ b/src/xous.rs @@ -20,7 +20,6 @@ pub type uintptr_t = usize; pub type ssize_t = isize; pub type off_t = i64; -pub type c_char = u8; pub type c_long = i64; pub type c_ulong = u64; pub type wchar_t = u32; From 315dd4cee0614a90757f8770fa58f8a83be1e42e Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Thu, 19 Dec 2024 08:20:27 +0000 Subject: [PATCH 2/3] Remove the `c_char_def` workaround for OpenBSD The exception was added after the PR with 0a02b941cf ("Define c_char at top-level...") was posted. Remove this skip since the same commit makes it no longer relevant. (backport ) (cherry picked from commit 2bb023e81743c5319226b749179c7d5aeff4cfa3) --- libc-test/build.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/libc-test/build.rs b/libc-test/build.rs index a82ae56e2e81e..d023c466a3915 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -644,11 +644,6 @@ fn test_openbsd(target: &str) { } }); - cfg.skip_type(move |ty| { - // `c_char_def` is always public but not always reexported. - ty == "c_char_def" - }); - cfg.type_name(move |ty, is_struct, is_union| { match ty { // Just pass all these through, no need for a "struct" prefix From 37ac889cbe63771e921ddb33b0c708e551c6c077 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Thu, 19 Dec 2024 09:01:31 +0000 Subject: [PATCH 3/3] Remove `c_char` from the PSP module ef8c0f31b1 ("Define c_char at top-level...") removes the need for per-OS definitions of `c_char`. Remove the definition of `c_char` from PEP, which as not covered in the backport (as this module does not exist on `main`). Suggested-by: Taiki Endo --- src/psp.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/psp.rs b/src/psp.rs index e1bf285967ede..ed9d4f4d5b415 100644 --- a/src/psp.rs +++ b/src/psp.rs @@ -25,7 +25,6 @@ pub type intptr_t = isize; pub type uintptr_t = usize; pub type ssize_t = isize; -pub type c_char = u8; pub type c_long = i64; pub type c_ulong = u64;