rust-bindgen
rust-bindgen copied to clipboard
Automatically generates Rust FFI bindings to C (and some C++) libraries.
I have encountered a C header file like the following in the wild: ``` struct A { int x; }; typedef struct A B; struct B; void foo(B *b); ```...
#2993 loosened `--rust-target` parsing to accept "any*" Rust version output. Unfortunately, this does not include all of the possible `rustc --version` output varieties. The following apparently-valid version strings result in...
Reproduction: C++: ```cpp /** * */ template class UniquePtr { T* ptr; }; #include template class au { std::unique_ptr aw; }; class bb; using bc = au; ``` Command-line: `cargo...
Reproduction: Input C++: ```cpp namespace a { typedef int b; //inline namespace c {} template class aa; inline namespace c { template class e; } typedef e f; template struct...
Reproduction: ```cpp /** * */ class CxxString { char* ptr; }; #include #include typedef std::string my_string; struct A { my_string a; }; struct B { std::string a; }; ``` Command:...
I have an enum like this in C: ```c enum SHType : uint8_t { None, Any, Enum, Bool, ... } ``` Turns into: ```rs pub const SHType_None: SHType = 0;...
Downstream postprocessors such as autocxx may want to use bindgen's representation of types to generate additional C++ code. bindgen is remarkably faithful at passing through enough information to make this...
This change reports extra C++ information about items: * Whether methods are virtual or pure virtual or neither * Whether a method is a "special member", e.g. a move constructor...
### Input C/C++ Header ```C struct foo { int a; int b; }; static const struct foo FOO1 = { .a = 12, .b = 23, }; ``` ### Bindgen...
Looking at this patch that Christoph Hellwig NAKed https://lore.kernel.org/linux-kernel/[email protected]/ and comparing to https://github.com/torvalds/linux/blob/master/include/linux/dma-mapping.h Maybe ask question why is there so much duplication. Then going hang on there is not enough...