pub mod aarch64;
pub mod x86_64;
pub use cpudetect_macros::target_family;
macro_rules! declare_is_compatible {
($family:literal $(, $feature:literal)* $(,)?) => {
pastey::paste! {
#[doc = concat!(
"Returns `true` if the current CPU is compatible with the `",
$family,
"` feature set."
)]
#[must_use]
#[inline(always)]
#[cfg(any(feature = "static", not(feature = "enabled")))]
pub fn [<is_ $family _compatible>]() -> bool {
true $(&& [<has_ $feature>]())*
}
#[doc = concat!(
"Returns `true` if the current CPU is compatible with the `",
$family,
"` feature set."
)]
#[must_use]
#[inline]
#[cfg(not(any(feature = "static", not(feature = "enabled"))))]
pub fn [<is_ $family _compatible>]() -> bool {
use std::sync::LazyLock;
#[allow(non_upper_case_globals)]
static [<lazy_ $family>]: LazyLock<bool> = LazyLock::new(|| {
true $(&& [<has_ $feature>]())*
});
*[<lazy_ $family>]
}
}
};
}
pub(crate) use declare_is_compatible;