try to fix exif feature build on Linux

This commit is contained in:
2022-03-03 12:56:59 +08:00
parent 0643defd86
commit 853719ed0b
3 changed files with 4 additions and 2 deletions

View File

@@ -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);

View File

@@ -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"));

View File

@@ -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;
}