rust-bindgen
rust-bindgen copied to clipboard
Automatically generates Rust FFI bindings to C (and some C++) libraries.
As seen in https://github.com/rust-lang/rfcs/issues/793 and https://github.com/rust-lang/libc/issues/355, C’s `_Complex` has a different ABI (but not layout) to what Bindgen currently generates, which is: ```rs #[derive(PartialEq, Copy, Clone, Hash, Debug, Default)] #[repr(C)]...
Test fails for aarch64-unknown-linux-gnu. How to reproduce: ``` $ cargo run -- --wrap-static-fns bindgen-tests/tests/headers/wrap-static-fns.h -- -target aarch64-unknown-linux-gnu Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.08s Running `target/debug/bindgen --wrap-static-fns bindgen-tests/tests/headers/wrap-static-fns.h...
error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop` to be used in a union --> ./open/162/generated_bindings.rs:12:5 | 12 | pub _M_val: _Tp, | ^^^^^^^^^^^^^^^ | = note: union...
Hi, I have the following static inline C function (from the ARM CMSIS): ```c __STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) { *pPreemptPriority =...
As far as I understand, currently: - If bindings are generated for a class, bindings are also generated for all members of the class, as far as this is supported...
When compiling https://github.com/JMS55/dlss_wgpu/tree/deabf142d371b0f7700afc2741b9b43eb670b286. ``` warning[E0133]: call to unsafe function `std::intrinsics::transmute` is unsafe and requires unsafe block --> D:\dlss_wgpu\target\debug\build\dlss_wgpu-6adfd00d523bab83\out/bindings.rs:12:9 | 12 | ::std::mem::transmute(self) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function | =...
The following script run on Windows will generate file `header.rs` which has first four lines ending with CRLF and rest ending with LF: ```bat cd %~dp0 echo int foo; >...
See the attached rust crate, which generates a binding for a simple structure in a c99 h file. When the `cargo build` command is run, `build.rs` generates a binding file,...
although currently we have `generate-inline-functions`, this flag requires user modify the build script and adding `-fkeep-inline-functions` flag, which is not supported by `clang`. i'm wondering if we could generate c...
The interface and/or implementation of `bindgen::callbacks::ParseCallbacks` may need some changes to address a compile warning that may become an error in the future, see https://github.com/rust-lang/rust/issues/79202. I'm guessing that the very...