commit | c3955ddeac236f4a6b967d5b8ddc8dc21238d152 | [log] [tgz] |
---|---|---|
author | bors-servo <lbergstrom+bors@mozilla.com> | Sun Jul 01 05:07:36 2018 -0400 |
committer | GitHub <noreply@github.com> | Sun Jul 01 05:07:36 2018 -0400 |
tree | a389e0dfd1a4ee9b9b156d560060ac2f12cc1a6f | |
parent | 0176a76fbfc861c70f7e93289c1c114de16e7282 [diff] | |
parent | a64289400ccbd58d12341da26dd1f3bebb17f845 [diff] |
Auto merge of #1342 - psumbera:master, r=emilio Fix bitfields on big-endian machines. Fixes #1340
bindgen
impl period
has been started! Join us at Gitter.im.
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! 📚
API reference documentation is on docs.rs