diff --git a/build.rs b/build.rs index 5bae004..e903301 100644 --- a/build.rs +++ b/build.rs @@ -28,13 +28,13 @@ fn main() { let mut f = File::open(dep_path).unwrap(); let mut s = String::from(""); f.read_to_string(&mut s).unwrap(); - println!("cargo:rustc-link-lib=static=exif"); let l: Vec<&str> = s.split(";").collect(); for i in l.iter() { let mut p = PathBuf::from(i); let p2 = p.clone(); let file_name = p2.file_stem().unwrap(); let file_name = file_name.to_str().unwrap(); + let file_name = file_name.trim_start_matches("lib"); p.pop(); let pa = p.to_str().unwrap(); if pa != "" { @@ -70,6 +70,7 @@ fn main() { let p2 = p.clone(); let file_name = p2.file_stem().unwrap(); let file_name = file_name.to_str().unwrap(); + let file_name = file_name.trim_start_matches("lib"); p.pop(); println!("cargo:rustc-link-search={}", p.to_str().unwrap()); println!("cargo:rustc-link-lib={}", file_name); diff --git a/src/_exif.rs b/src/_exif.rs index 4948891..7646744 100644 --- a/src/_exif.rs +++ b/src/_exif.rs @@ -2,4 +2,5 @@ #![allow(non_snake_case)] #![allow(dead_code)] #![allow(deref_nullptr)] +#![allow(non_upper_case_globals)] include!(concat!(env!("OUT_DIR"), "/exif.rs")); diff --git a/src/exif.rs b/src/exif.rs index 5e8299c..a96aa42 100644 --- a/src/exif.rs +++ b/src/exif.rs @@ -477,7 +477,7 @@ impl ExifValue { if n >= c { return None; } - let r = unsafe { _exif::exif_value_to_int64(self.value, n as i32) }; + let r = unsafe { _exif::exif_value_to_int64(self.value, n as c_long) }; if !self.ok() { return None; }