mirror of
https://github.com/lifegpc/pixiv_downloader.git
synced 2026-07-08 01:32:41 +08:00
try to fix exif feature build on Linux
This commit is contained in:
3
build.rs
3
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);
|
||||
|
||||
@@ -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"));
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user