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

I am searching advice on how this can be handled gracefully other than keeping a project-local header that is used to generate bindings (or pre-generated bindings). ### Input C/C++ Header...

### Input C/C++ Header ```C++ #define DEPRECATE(f) __attribute__((__deprecated__("Use '" #f "' instead"))) DEPRECATE(bar) int foo(); int bar(); ``` ### Bindgen Invocation ```Rust bindgen::Builder::default() .header("input.h") .generate() .unwrap() ``` ### Actual Results...

### Input C/C++ Header ```C++ const char BUFFER[] = "Hello" "\0" "World" "\0"; ``` ### Bindgen Invocation ```Rust bindgen::Builder::default() .header("input.h") .generate() .unwrap() ``` ### Actual Results ```rust pub const BUFFER:...

### Input C/C++ Header ```C++ typedef struct _IMAGE_TLS_DIRECTORY64 { ULONGLONG StartAddressOfRawData; ULONGLONG EndAddressOfRawData; ULONGLONG AddressOfIndex; // PDWORD ULONGLONG AddressOfCallBacks; // PIMAGE_TLS_CALLBACK *; DWORD SizeOfZeroFill; union { DWORD Characteristics; struct {...

### Input C/C++ Header ```C typedef __builtin_va_list va_list; void foo(va_list arg); ``` ### Bindgen Invocation ``` $ bindgen input.h ``` ### Actual Results - on arm64 macos ```c /* automatically...

```rust > .\target\debug\bindgen.exe thread 'main' has overflowed its stack ``` Stack trace: ```rust bindgen.exe!__chkstk() Line 109 Unknown > bindgen.exe!bindgen::options::impl$3::augment_args(clap::builder::command::Command __clap_app) Line 90 Unknown bindgen.exe!bindgen::options::impl$1::command() Line 90 Unknown bindgen.exe!clap::derive::Parser::parse_from(std::env::Args itr) Line...

### Input C/C++ Header ```C++ void new_function_name(void); #define old_function_name new_function_name ``` ### Bindgen Invocation ``` $ bindgen header.h ``` ### Actual Results ```rust /* automatically generated by rust-bindgen 0.65.1 */...

A-macros

(this is a feature request) Hello, I was wondering you were interested in letting `bindgen::Builder` provide a `HashMap`, or something similar, mapping the original name of a C-type to its...

### Input C/C++ Header ```C++ #define CK_INVALID_HANDLE (0UL) ``` ### Bindgen Invocation ```Rust bindgen::Builder::default() .header("input.h") .generate() .expect("Unable to generate bindings"); ``` ### Actual Results ```rust pub const CK_INVALID_HANDLE: ::std::os::raw::c_uint =...

enhancement

We can't invoke the C++ compiler to generate new instantiations of templates, so I don't think we even try to keep track of them currently. However, we could track explicit...

E-less-easy
A-templates