rust-bindgen icon indicating copy to clipboard operation
rust-bindgen copied to clipboard

Automatically generates Rust FFI bindings to C (and some C++) libraries.

Results 460 rust-bindgen issues
Sort by recently updated
recently updated
newest added

This PR adds a new option `--unsafe-blocks` which wraps all the bodies of generated `unsafe` functions in `unsafe` blocks. Fixes: #2063 ~~Blocked by: #2265~~

This PR adds a new option `--merge-extern-blocks` which merges all the extern blocks with the same ABI and attributes in a single one. Fixes https://github.com/rust-lang/rust-bindgen/issues/564. ~~Blocked by: #2265.~~

Projects wishing to use `unsafe_op_in_unsafe_fn` can `allow` the warning when importing the bindings. However, it would be ideal if `bindgen` would offer a way (e.g. command-line flag) to generate bindings...

enhancement
help wanted

It would be nice if the manual provided an example of a non-system library. There are probably two common cases: - The source code is available and the library needs...

I-needs-docs

Bindgen documentation says to add `-x c++` to parse c++ headers, so I've done what seems to be logical: `.clang_arg("-x c++")`. This caused quite unhelpful error: ``` --- stderr thread...

enhancement
help wanted

Partially fixes: https://github.com/rust-lang/rust-bindgen/issues/2231 r? @emilio @amanjeev

Depends on https://github.com/jethrogb/rust-cexpr/pull/33. Built-in types are already working, but I don't know how to support custom types since types are parsed after macros. I made evaluation of `Var::ty` for custom...

### Input C/C++ Header ```C #include #define A 42 #define B UINT_MAX static const unsigned int C = UINT_MAX; ``` ### Bindgen Invocation Both `bindgen defines.h` and a minimal `builder().header("defines.h").generate()?.write_to_file(…)`...

enhancement
help wanted

Currently, `bindgen` uses `libclang` to understand C/C++ code. https://github.com/rust-lang/rust-bindgen/pull/1740 considers moving to a lower-level interface for LLVM, with discussion of whether keeping support for several interfaces is feasible. It would...

enhancement
rust-for-linux