rust: add safe bindings to bdiff.c
I wrote C FFI bindings manually rather than using a bindgen build step because
there are only 2 structs and 3 functions and they're not going to change.
Note that the relative path in build.rs means that cargo publish will no longer
work. If in the future we want to publish to crates.io, we would probably need
to add a Makefile step that copies bdiff sources into the hg-core crate.
fn main() {
// The relative paths work locally but won't if published to crates.io.
println!("cargo::rerun-if-changed=../../mercurial/bdiff.c");
println!("cargo::rerun-if-changed=../../mercurial/bdiff.h");
println!("cargo::rerun-if-changed=../../mercurial/compat.h");
println!("cargo::rerun-if-changed=../../mercurial/bitmanipulation.h");
cc::Build::new()
.warnings(true)
.file("../../mercurial/bdiff.c")
.compile("bdiff");
}