commit | 8fa15cc9b93bffdb93ac05c374eca25157bcf281 | [log] [tgz] |
---|---|---|
author | bors-servo <lbergstrom+bors@mozilla.com> | Fri Jan 19 13:06:48 2018 -0600 |
committer | GitHub <noreply@github.com> | Fri Jan 19 13:06:48 2018 -0600 |
tree | 3ed6980d2308c000f42f4c0e670738bf9ee66219 | |
parent | d3d69c6d33bd22b7edee560d59dab8946911cc0e [diff] | |
parent | fbb6d6f6240895d224ee3b475f8739b414fbc564 [diff] |
Auto merge of #1228 - emilio:repr-c-enums, r=fitzgen codegen: Don't generate repr(C) for enums. That's only undefined for enums with fields. Fixes #1224 See also: https://botbot.me/mozilla/rustc/2018-01-19/?msg=95934948&page=2
bindgen
impl period
has been started! Join us at Gitter.im.
bindgen
automatically generates Rust FFI bindings to C and 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! 📚
API reference documentation is on docs.rs