From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- library/std/src/os/raw/mod.rs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 library/std/src/os/raw/mod.rs (limited to 'library/std/src/os/raw/mod.rs') diff --git a/library/std/src/os/raw/mod.rs b/library/std/src/os/raw/mod.rs new file mode 100644 index 000000000..19d0ffb2e --- /dev/null +++ b/library/std/src/os/raw/mod.rs @@ -0,0 +1,31 @@ +//! Compatibility module for C platform-specific types. Use [`core::ffi`] instead. + +#![stable(feature = "raw_os", since = "1.1.0")] + +#[cfg(test)] +mod tests; + +macro_rules! alias_core_ffi { + ($($t:ident)*) => {$( + #[stable(feature = "raw_os", since = "1.1.0")] + #[doc = include_str!(concat!("../../../../core/src/ffi/", stringify!($t), ".md"))] + // Make this type alias appear cfg-dependent so that Clippy does not suggest + // replacing expressions like `0 as c_char` with `0_i8`/`0_u8`. This #[cfg(all())] can be + // removed after the false positive in https://github.com/rust-lang/rust-clippy/issues/8093 + // is fixed. + #[cfg(all())] + #[doc(cfg(all()))] + pub type $t = core::ffi::$t; + )*} +} + +alias_core_ffi! { + c_char c_schar c_uchar + c_short c_ushort + c_int c_uint + c_long c_ulong + c_longlong c_ulonglong + c_float + c_double + c_void +} -- cgit v1.2.3