rust-lang / libc

Raw bindings to platform APIs for Rust
https://docs.rs/libc
Apache License 2.0
2.03k stars 1.01k forks source link

Provide support for `fast` integer types #631

Open cramertj opened 7 years ago

cramertj commented 7 years ago

libc currently provides a number of convenient integer type aliases. However, the least and fast integer types (e.g. int_fast16_t, etc.) aren't currently included. Is there a reason for their exclusion, or is this just awaiting an implementation?

alexcrichton commented 7 years ago

Nah just awaiting an implementation!

kellda commented 3 years ago

After some research in apple's libc, musl and glibc, I found that [u]int_least(n)_t == [u]int(n)_t. For [u]int_fast(n)_t, however, it's more complicated:

bits 8 16 32 64
apple 8 16 32 64
glibc 32 char int int long long
glibc 64 char long long long
musl 8 32 32 64

How to know which typedef to put in this crate ?

kellda commented 3 years ago

@alexcrichton or someone else could you mentor me to implement fast types alises ?

workingjubilee commented 1 year ago

In #1838 it was noticed that the "least" aliases resolve exactly to our types, so they were omitted for the same reason that the fixed-width aliases were deprecated.