commit | b1a1ebc918e44f4aa928878dae20fa7be6c87043 | [log] [tgz] |
---|---|---|
author | Emilio Cobos Álvarez <emilio@crisal.io> | Thu May 14 04:24:32 2020 +0200 |
committer | Emilio Cobos Álvarez <emilio@crisal.io> | Thu May 14 12:58:30 2020 +0200 |
tree | 3b0c3cb839aac0c2f056cc06126b1e139058312e | |
parent | fcc10961dbfe128d2e592cb302316122938d7b58 [diff] |
ir: Fall back to get the cursors from the type if we find no param decls. It seems libclang sometimes doesn't expose the right paramdecl cursors. This should be reported upstream, but it's easy enough to workaround. It loses the parameter names which is a bit unfortunate but... Fixes #1778
bindgen
bindgen
automatically generates Rust FFI bindings to C (and some C++) libraries.
For example, given the C header doggo.h
:
typedef struct Doggo { int many; char wow; } Doggo; void eleven_out_of_ten_majestic_af(Doggo* pupper);
bindgen
produces Rust FFI code allowing you to call into the doggo
library's functions and use its types:
/* automatically generated by rust-bindgen */ #[repr(C)] pub struct Doggo { pub many: ::std::os::raw::c_int, pub wow: ::std::os::raw::c_char, } extern "C" { pub fn eleven_out_of_ten_majestic_af(pupper: *mut Doggo); }
📚 Read the bindgen
users guide here! 📚
The minimum supported Rust version is 1.34.
No MSRV bump policy has been established yet, so MSRV may increase in any release.
API reference documentation is on docs.rs