1//! Compatibility module for C platform-specific types. Use [`core::ffi`] instead.
23#![stable(feature = "raw_os", since = "1.1.0")]
45#[cfg(test)]
6mod tests;
78macro_rules!alias_core_ffi {
9 ($($t:ident)*) => {$(
10#[stable(feature = "raw_os", since = "1.1.0")]
11 #[doc = include_str!(concat!("../../../../core/src/ffi/", stringify!($t), ".md"))]
12// #[doc(cfg(all()))] // commented out for std.noratrieb.dev
13pub type $t = core::ffi::$t;
14 )*}
15}
1617#[stable(feature = "raw_os", since = "1.1.0")]
#[doc =
"Equivalent to C\'s `void` type when used as a [pointer].\n\nIn essence, `*const c_void` is equivalent to C\'s `const void*`\nand `*mut c_void` is equivalent to C\'s `void*`. That said, this is\n*not* the same as C\'s `void` return type, which is Rust\'s `()` type.\n\nTo model pointers to opaque types in FFI, until `extern type` is\nstabilized, it is recommended to use a newtype wrapper around an empty\nbyte array. See the [Nomicon] for details.\n\nOne could use `std::os::raw::c_void` if they want to support old Rust\ncompiler down to 1.1.0. After Rust 1.30.0, it was re-exported by\nthis definition. For more information, please read [RFC 2521].\n\n[Nomicon]: https://doc.rust-lang.org/nomicon/ffi.html#representing-opaque-structs\n[RFC 2521]: https://github.com/rust-lang/rfcs/blob/master/text/2521-c_void-reunification.md\n"]
pub type c_void = core::ffi::c_void;alias_core_ffi! {
18c_charc_scharc_uchar19c_shortc_ushort20c_intc_uint21c_longc_ulong22c_longlongc_ulonglong23c_float24c_double25c_void26}