commit | 01a3e621d222c09df010a9f970a63851c251f60a | [log] [tgz] |
---|---|---|
author | Michael Woerister <michaelwoerister@posteo> | Mon May 13 12:35:03 2019 +0200 |
committer | Emilio Cobos Álvarez <emilio@crisal.io> | Wed May 15 00:22:37 2019 +0200 |
tree | 2e234ad42ea5156f8a6526e2ff76d6ba0104da66 | |
parent | e262df53cc074929bb2026377016d8d540954a9f [diff] |
Add test cases for x86 Windows calling conventions.
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! 📚
API reference documentation is on docs.rs