rust-bindgen
rust-bindgen copied to clipboard
Automatically generates Rust FFI bindings to C (and some C++) libraries.
``` #define DRM_RS_IOCTL(FOO) \ static const unsigned long DRM_RS_IOCTL_##FOO = DRM_IOCTL_##FOO DRM_RS_IOCTL(NOUVEAU_EXEC); ``` becomes [nak_bindings.rs.txt](https://github.com/user-attachments/files/17426700/nak_bindings.rs.txt) and code fails later with ``` error[E0425]: cannot find value `DRM_RS_IOCTL_NOUVEAU_EXEC` in this scope ```...
Doxygen seems to be commonly used in C/C++ projects, and its annotations look pretty messy in Rustdoc. `bindgen` chose to offload processing of Doxygen annotations to `doxygen-rs`. The problem is...
Currently there is only `--sort-semantically` to sort by item type. Sorting by name would make it easier to diff bindings generated for different platforms that have different order of items...
liburing will define macros as such: ```c enum io_uring_sqe_flags_bit { IOSQE_FIXED_FILE_BIT, IOSQE_IO_DRAIN_BIT, IOSQE_IO_LINK_BIT, IOSQE_IO_HARDLINK_BIT, IOSQE_ASYNC_BIT, IOSQE_BUFFER_SELECT_BIT, IOSQE_CQE_SKIP_SUCCESS_BIT, }; /* * sqe->flags */ /* use fixed fileset */ #define IOSQE_FIXED_FILE (1U
I noticed CI failures in #2951 because libtinfo5 is no longer available in ubuntu-latest since https://github.com/actions/runner-images/issues/10636. ```console Run sudo apt-get update sudo apt-get update sudo apt-get install libtinfo5 shell: /usr/bin/bash...
The following is minimized from Xcode's C++ standard library implementation. ```cpp // namespace.h #pragma once #define BEGIN_NAMESPACE namespace repro { inline namespace __1 { #define END_NAMESPACE } } ``` ```cpp...
I was chatting with @pvdrz at the Rust for Linux conference about some bold ideas for `bindgen` and he thought I should write them up, so here goes. ## The...
Although #1636 was fixed, using `builder.clang_macro_fallback()` does not work with macros that expand to values that do not fit in a `u32`. It is potentially related to #2618. ``` //...
bindgen identifies unused template parameters in std::unique_ptr<std::string> with latest Mac OS SDK
Using bindgen HEAD revision 7cc26581. `input.hpp` contains: ```cpp /** * */ template class UniquePtr { T* ptr; }; /** * */ class CxxString { char* ptr; }; #include #include std::unique_ptr...