From d429d0df33ef0d726058fdc2611e78060703a7ec Mon Sep 17 00:00:00 2001 From: Thom Chiovoloni Date: Sat, 30 Oct 2021 10:54:34 -0700 Subject: [PATCH 1/2] Replace `std::os::raw::c_ssize_t` with `std::os::raw::c_ptrdiff_t` --- library/std/src/os/raw/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/std/src/os/raw/mod.rs b/library/std/src/os/raw/mod.rs index 30eeac14b43f5..e25eaf63bcd00 100644 --- a/library/std/src/os/raw/mod.rs +++ b/library/std/src/os/raw/mod.rs @@ -165,9 +165,9 @@ pub use core::ffi::c_void; #[unstable(feature = "c_size_t", issue = "88345")] pub type c_size_t = usize; -/// Equivalent to C's `ssize_t` type, from `stddef.h` (or `cstddef` for C++). +/// Equivalent to C's `ptrdiff_t` type, from `stddef.h` (or `cstddef` for C++). /// /// This type is currently always [`isize`], however in the future there may be /// platforms where this is not the case. #[unstable(feature = "c_size_t", issue = "88345")] -pub type c_ssize_t = isize; +pub type c_ptrdiff_t = isize; From 8d19819781318c6ba24240af4b0038b692dd627f Mon Sep 17 00:00:00 2001 From: Thom Chiovoloni Date: Sun, 31 Oct 2021 13:01:57 -0700 Subject: [PATCH 2/2] Re-add `std::os::raw::c_ssize_t`, with more accurate documentation --- library/std/src/os/raw/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/library/std/src/os/raw/mod.rs b/library/std/src/os/raw/mod.rs index e25eaf63bcd00..01392ffab79ca 100644 --- a/library/std/src/os/raw/mod.rs +++ b/library/std/src/os/raw/mod.rs @@ -171,3 +171,10 @@ pub type c_size_t = usize; /// platforms where this is not the case. #[unstable(feature = "c_size_t", issue = "88345")] pub type c_ptrdiff_t = isize; + +/// Equivalent to C's `ssize_t` (on POSIX) or `SSIZE_T` (on Windows) type. +/// +/// This type is currently always [`isize`], however in the future there may be +/// platforms where this is not the case. +#[unstable(feature = "c_size_t", issue = "88345")] +pub type c_ssize_t = isize;