linux-stable/rust
Gary Guo 2fd6f55c04 rust: map __kernel_size_t and friends also to usize/isize
Currently bindgen has special logic to recognise `size_t` and `ssize_t`
and map them to Rust `usize` and `isize`. Similarly, `ptrdiff_t` is
mapped to `isize`.

However this falls short for `__kernel_size_t`, `__kernel_ssize_t` and
`__kernel_ptrdiff_t`. To ensure that they are mapped to usize/isize
rather than 32/64 integers depending on platform, blocklist them in
bindgen parameters and manually provide their definition.

Signed-off-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Trevor Gross <tmgross@umich.edu>
Link: https://lore.kernel.org/r/20240913213041.395655-3-gary@garyguo.net
[ Formatted comment. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2024-11-10 23:58:00 +01:00
..
bindings rust: map __kernel_size_t and friends also to usize/isize 2024-11-10 23:58:00 +01:00
helpers rust: helpers: remove unnecessary header includes 2024-10-21 17:35:59 +02:00
kernel rust: sync: add global lock support 2024-11-10 22:56:57 +01:00
macros rust: macros: enable the rest of the tests 2024-11-01 22:02:53 +01:00
uapi rust: map __kernel_size_t and friends also to usize/isize 2024-11-10 23:58:00 +01:00
.gitignore rust: support running Rust documentation tests as KUnit ones 2023-07-19 09:32:53 -06:00
bindgen_parameters rust: map __kernel_size_t and friends also to usize/isize 2024-11-10 23:58:00 +01:00
build_error.rs rust: add build_error crate 2022-12-04 01:59:16 +01:00
compiler_builtins.rs rust: add intrinsics to fix -Os builds 2024-08-10 00:05:10 +02:00
exports.c rust: exports: improve grammar in commentary 2024-10-21 17:35:33 +02:00
Makefile rust: fix size_t in bindgen prototypes of C builtins 2024-11-10 23:54:43 +01:00