about summary refs log tree commit diff
path: root/library/std/src/os/raw
AgeCommit message (Collapse)AuthorLines
2024-05-20Remove Windows dependency on libcBen Kimock-0/+2
2023-06-16Remove `#[cfg(all())]` workarounds from `c_char`Alex Macleod-5/+0
2022-03-01Provide C FFI types via core::ffi, not just in stdJosh Triplett-216/+21
The ability to interoperate with C code via FFI is not limited to crates using std; this allows using these types without std. The existing types in `std::os::raw` become type aliases for the ones in `core::ffi`. This uses type aliases rather than re-exports, to allow the std types to remain stable while the core types are unstable. This also moves the currently unstable `NonZero_` variants and `c_size_t`/`c_ssize_t`/`c_ptrdiff_t` types to `core::ffi`, while leaving them unstable.
2021-12-07Work around Clippy false positive on `as c_char`David Tolnay-0/+5
2021-12-07Define c_char using cfg_if rather than repeating 40-line cfgDavid Tolnay-88/+57
2021-11-27Add riscv64gc-unknown-freebsdTobias Kortkamp-2/+4
2021-10-31Re-add `std::os::raw::c_ssize_t`, with more accurate documentationThom Chiovoloni-0/+7
2021-10-30Replace `std::os::raw::c_ssize_t` with `std::os::raw::c_ptrdiff_t`Thom Chiovoloni-2/+2
2021-10-05Suppress some cfg from being shown in the stdlib docsWim Looman-0/+6
2021-09-20Fix a technicality regarding the size of C's `char` typeNadja Reitzenstein-1/+1
Specifically, ISO/IEC 9899:2018 — better known as "C18" — (and at least C11, C99 and C89) do not specify the size of `byte` in bits. Section 3.6 defines "byte" as "addressable unit of data storage" while section 6.2.5 ("Types") only defines "char" as "large enough to store any member of the basic execution set" giving it a lower bound of 7 bit (since there are 96 characters in the basic execution set). With section 6.5.3.4 paragraph 4 "When sizeof is applied to an operant that has type char […] the result is 1" you could read this as the size of `char` in bits being defined as exactly the same as the number of bits in a byte but it's also valid to read that as an exception. In general implementations take `char` as the smallest unit of addressable memory, which for modern byte-addressed architectures is overwhelmingly 8 bits to the point of this convention being completely cemented into just about all of our software. So is any of this actually relevant at all? I hope not. I sincerely hope that this never, ever comes up. But if for some reason a poor rustacean is having to interface with C code running on a Cray X1 that in 2003 is still doing word-addressed memory with 64-bit words and they trust the docs here blindly it will blow up in her face. And I'll be truly sorry for her to have to deal with … all of that.
2021-08-25Reference tracking issueThom Chiovoloni-2/+2
2021-08-25Add `c_size_t` and `c_ssize_t` to `std::os::raw`.Thom Chiovoloni-0/+14
2021-02-23Use #[doc = include_str!()] in stdLeSeulArtichaut-1/+1
2021-02-21update tracking issue for raw_os_nonzeroAshley Mannix-1/+1
2021-02-17Provide NonZero_c_* integersIan Jackson-18/+47
I'm pretty sure I am going want this for #73125 and it seems like an omission that would be in any case good to remedy. It's a shame we don't have competent token pasting and case mangling for use in macro_rules!. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2021-02-17std::src::os::raw: Refactor, introducing macro type_alias!Ian Jackson-54/+27
This file contained a lot of repetitive code. This was about to get considerably worse, with introduction of a slew of new aliases. No functional change. I've eyeballed the docs and they don't seem to have changed either. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2020-09-16library/std: raw: Add support for RISC-V 32-bitAlistair Francis-2/+4
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2020-09-04Remove a useless allowed attrLzu Tao-2/+0
2020-08-31std: move "mod tests/benches" to separate filesLzu Tao-21/+20
Also doing fmt inplace as requested.
2020-08-14remove primitive type linksPrabakaran Kumaresshan-20/+0
2020-08-14Switch to intra-doc links in os/raw/*.mdPrabakaran Kumaresshan-33/+33
2020-07-27mv std libs to library/mark-0/+257