From 4522d8c70d6df73cf1fce675b884ce66ce7f092c Mon Sep 17 00:00:00 2001 From: Polochon_street Date: Sun, 28 Jul 2024 00:01:40 +0200 Subject: [PATCH] Fix CI... ...After https://blog.rust-lang.org/2024/05/06/check-cfg.html landed --- Cargo.toml | 2 +- build.rs | 18 +++++++++++------- src/avutil/rational.rs | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f1ee40a..c2c5908 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ffmpeg-sys-next" -version = "7.0.0" +version = "7.0.1" build = "build.rs" links = "ffmpeg" diff --git a/build.rs b/build.rs index 4622987..4b3a19a 100644 --- a/build.rs +++ b/build.rs @@ -80,10 +80,10 @@ impl ParseCallbacks for Callbacks { let codec_flag_prefix = "AV_CODEC_FLAG_"; let error_max_size = "AV_ERROR_MAX_STRING_SIZE"; - if value >= i64::min_value() && _name.starts_with(ch_layout_prefix) { + if _name.starts_with(ch_layout_prefix) { Some(IntKind::ULongLong) - } else if value >= i32::min_value() as i64 - && value <= i32::max_value() as i64 + } else if value >= i32::MIN as i64 + && value <= i32::MAX as i64 && (_name.starts_with(codec_cap_prefix) || _name.starts_with(codec_flag_prefix)) { Some(IntKind::UInt) @@ -92,7 +92,7 @@ impl ParseCallbacks for Callbacks { name: "usize", is_signed: false, }) - } else if value >= i32::min_value() as i64 && value <= i32::max_value() as i64 { + } else if value >= i32::MIN as i64 && value <= i32::MAX as i64 { Some(IntKind::Int) } else { None @@ -151,7 +151,7 @@ fn source() -> PathBuf { fn search() -> PathBuf { let mut absolute = env::current_dir().unwrap(); - absolute.push(&output()); + absolute.push(output()); absolute.push("dist"); absolute @@ -361,7 +361,7 @@ fn build() -> io::Result<()> { if !Command::new("make") .arg("-j") .arg(num_cpus::get().to_string()) - .current_dir(&source()) + .current_dir(source()) .status()? .success() { @@ -370,7 +370,7 @@ fn build() -> io::Result<()> { // run make install if !Command::new("make") - .current_dir(&source()) + .current_dir(source()) .arg("install") .status()? .success() @@ -525,6 +525,10 @@ fn check_features( continue; } } + // Here so the features are listed for rust-ffmpeg at build time. Does + // NOT represent activated features, just features that exist (hence the + // lack of "=true" at the end) + println!(r#"cargo:{}="#, var); let var_str = format!("[{var}]", var = var); let pos = var_str.len() diff --git a/src/avutil/rational.rs b/src/avutil/rational.rs index 641e09f..8c7c91f 100644 --- a/src/avutil/rational.rs +++ b/src/avutil/rational.rs @@ -17,7 +17,7 @@ pub unsafe fn av_cmp_q(a: AVRational, b: AVRational) -> c_int { } else if a.num != 0 && b.num != 0 { ((i64::from(a.num) >> 31) - (i64::from(b.num) >> 31)) as c_int } else { - c_int::min_value() + c_int::MIN } }