]> git.lizzy.rs Git - rust.git/commitdiff
Add `c_size_t` and `c_ssize_t` to `std::os::raw`.
authorThom Chiovoloni <chiovolonit@gmail.com>
Wed, 25 Aug 2021 18:25:26 +0000 (11:25 -0700)
committerThom Chiovoloni <chiovolonit@gmail.com>
Wed, 25 Aug 2021 18:25:26 +0000 (11:25 -0700)
library/std/src/os/raw/mod.rs

index 50464a050c70688b0112df517e90aef932329d62..7ce58fb1d0ff76a4ec77a8c71cab97d3cbd6ea1d 100644 (file)
@@ -151,3 +151,17 @@ macro_rules! type_alias {
 #[stable(feature = "raw_os", since = "1.1.0")]
 #[doc(no_inline)]
 pub use core::ffi::c_void;
+
+/// Equivalent to C's `size_t` type, from `stddef.h` (or `cstddef` for C++).
+///
+/// This type is currently always [`usize`], however in the future there may be
+/// platforms where this is not the case.
+#[unstable(feature = "c_size_t", issue = "none")]
+pub type c_size_t = usize;
+
+/// Equivalent to C's `ssize_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 = "none")]
+pub type c_ssize_t = isize;