Bug 1758021 - Get is_{arm,aarch64}_feature_detected from std::arch on rustc >= 1.60. r=gfx-reviewers,jrmuizel

Differential Revision: https://phabricator.services.mozilla.com/D140278
This commit is contained in:
Mike Hommey 2022-03-04 00:39:40 +00:00
Родитель 3f85a16731
Коммит f7b39f73c2
5 изменённых файлов: 17 добавлений и 0 удалений

1
Cargo.lock сгенерированный
Просмотреть файл

@ -4120,6 +4120,7 @@ name = "qcms"
version = "0.2.0"
dependencies = [
"libc",
"rustc_version",
]
[[package]]

Просмотреть файл

@ -20,3 +20,6 @@ cmyk = []
[dependencies]
libc = {version = "0.2", optional = true }
[build-dependencies]
rustc_version = "0.2"

Просмотреть файл

@ -1,3 +1,5 @@
use rustc_version::{version, Version};
fn main() {
if cfg!(feature = "neon") && std::env::var_os("RUSTC_BOOTSTRAP").is_none() {
// With Rust 1.50 and newer RUSTC_BOOTSTAP should
@ -9,4 +11,7 @@ fn main() {
if target.contains("neon") {
println!("cargo:rustc-cfg=libcore_neon");
}
if version().unwrap() >= Version::parse("1.60.0-alpha").unwrap() {
println!("cargo:rustc-cfg=std_arch");
}
}

Просмотреть файл

@ -6,6 +6,10 @@ mod gtest {
transform_util::lut_inverse_interp16, Intent::Perceptual,
};
use libc::c_void;
#[cfg(all(target_arch = "arm", std_arch))]
use std::arch::is_arm_feature_detected;
#[cfg(all(target_arch = "aarch64", std_arch))]
use std::arch::is_aarch64_feature_detected;
use std::ptr::null_mut;
#[cfg(any(target_arch = "arm", target_arch = "aarch64"))]

Просмотреть файл

@ -55,6 +55,10 @@ use crate::{
use std::sync::atomic::Ordering;
use std::sync::Arc;
#[cfg(all(target_arch = "arm", feature = "neon", std_arch))]
use std::arch::is_arm_feature_detected;
#[cfg(all(target_arch = "aarch64", feature = "neon", std_arch))]
use std::arch::is_aarch64_feature_detected;
pub const PRECACHE_OUTPUT_SIZE: usize = 8192;
pub const PRECACHE_OUTPUT_MAX: usize = PRECACHE_OUTPUT_SIZE - 1;