rust-bindgen
rust-bindgen copied to clipboard
Automatically generates Rust FFI bindings to C (and some C++) libraries.
Hi, and thanks for taking a look! :) ### Input C/C++ Header ```C++ template struct __attribute__Trans_NS___1_basic_string { int : sizeof(_Allocator); }; ``` ### Bindgen Invocation ```Rust bindgen::Builder::default() .allowlist_type(".*") .header("wrapper.hpp") .generate()...
This PR introduces a new flag `--tuple-varargs-len=` which can be used to emulate variadic methods using tuples of length up to ``. # Example If the generated function signature for...
I'm following the instructions for using libbindgen in build.rs, and I'm trying to generate bindings for a c library that uses glib. This example doesn't seem to quite meet my...
in #444 I pretty much wrapped everything in an `if` block, but @fitzgen suggested it may be a better idea to get the potential comment holders the context so they...
Use case: implement in Rust the functions defined in a .h. Currently I use bindgen + manual modifications (no_mangle, unimplemented!()).
GitHub issue 422 was fixed but needs a test. This was quick. https://github.com/rust-lang/rust-bindgen/issues/422 Closes #422 cc. @pvdrz
I worked off #2135 to find the right node to query about nullability attributes. I think this will: Closes #1876. Closes #1791. Supersede #2135.
https://github.com/rust-fuzz/cargo-fuzz Uses `libFuzzer` behind the scenes. Unsure if this is really worth it, hence "investigate" rather than "use". `libFuzzer` is pretty much throwing random bytes (whose next generations are then...
I am using this script (https://gist.github.com/fitzgen/187381e358f60efa8194d0b276b4d11a) for testing. The hashtag for my bindgen version is e841f6f88d13298. $ ./b.sh bindgen abc.h ``` clang-4.0: warning: treating 'c-header' input as 'c++-header' when in...
### Input C/C++ Header ```C++ enum class OriginFlags : char { UserAgent = 0x01, User = 0x02, Author = 0x04, All = 0x07, }; OriginFlags GetFlags(); ``` ### Bindgen Invocation...