Use the rust-bindgen crate properly

Using the changes from @gadomski along with some additional work, to get the
generated bindings working again. Works on macOS and FreeBSD 11. A couple of
hacks are needed for FreeBSD, but nothing too serious.

Changed to use the libc prefix, and changed to use the generated enums.

Fixes #22, #15, and #14

cargo test passes
This commit is contained in:
Nathan Fiedler
2017-04-08 16:03:58 -07:00
parent 4507d07c9c
commit e7054d3e35
14 changed files with 152 additions and 8244 deletions

View File

@ -22,9 +22,9 @@ pub trait FromRust<T> {
impl FromRust<bool> for bindings::MagickBooleanType {
fn from_rust(b: bool) -> Self {
if b {
bindings::MagickTrue
bindings::MagickBooleanType::MagickTrue
} else {
bindings::MagickFalse
bindings::MagickBooleanType::MagickFalse
}
}
}