rust-bindgen
rust-bindgen copied to clipboard
Automatically generates Rust FFI bindings to C (and some C++) libraries.
### Input C/C++ Header Note: In the real world, priority is an enum, but I wanted to keep this header minimal, as the outcome is the same. ```C++ extern "C"...
### Input C/C++ Header ```C // test.h #include ``` ### Bindgen Invocation ```Rust // build.rs bindgen::builder() .header("test.h") .generate() .expect("failed to bindgen"); ``` ``` cargo build --target wasm32-unknown-unknown cargo build --target...
### Input C/C++ Header ```cpp #include ``` really sorry for the include. I just don't know how to reproduce this minimally. It's just wxWidgets 3.1.3, built from source on macOS...
just a question, didn't see anything in the docs, thought I'd ask here.
If in C code I have this line: ``` typedef void (mi_cdecl mi_output_fun)(const char* msg, void* arg); ``` and this function: ``` mi_decl_export void mi_stats_print_out(mi_output_fun* out, void* arg) mi_attr_noexcept; ```...
### Input C/C++ Header ```C++ CAPI void alt_RotationLayout_CAPI_Free_Forward(struct alt_RotationLayout* ptr); typedef struct alt_RotationLayout { float roll; float pitch; float yaw; } alt_RotationLayout; CAPI void alt_RotationLayout_CAPI_Free(struct alt_RotationLayout* ptr); ``` ### Bindgen...
This bizarre edge case in a library I'm consuming has caused `bindgen` to segfault. I've simplified it the best I can: ```cpp // input.h template union Foo { Foo foo;...
The help message displays very poorly in 80-column terminals. If possible, the message printing should be terminal-size aware.
This bug was found with `csmith` and `driver.py`. ### Input Header ```c #include "csmith.h" struct S0 { unsigned a : 18; uint8_t b }; ``` ### `bindgen` Invocation ``` $...
Usecase: I have a struct in Gecko (`mozilla::gfx::Glyph`) that I would like to pass by-reference to a rust function which will read the fields. However this rust function (`gfx/webrender_bindings/src/bindings.rs:wr_dp_push_text`) is...