pub const GNU: bool = cfg!(target_env="gnu");
pub const MUSL: bool = cfg!(target_env="musl");
pub const SGX: bool = cfg!(target_env="sgx");
pub const MSVC: bool = cfg!(target_env="msvc");
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
pub struct cfg_target_env_info {
pub gnu: bool,
pub musl: bool,
pub sgx: bool,
pub msvc: bool,
}
pub const ALL_INFO: cfg_target_env_info = all_info();
pub const fn all_info() -> cfg_target_env_info {
cfg_target_env_info {
gnu: GNU,
musl: MUSL,
sgx: SGX,
msvc: MSVC,
}
}
#[cfg(feature = "json")]
impl cfg_target_env_info {
pub fn to_json(&self) -> serde_json::Value {
serde_json::json!({
"gnu": self.gnu,
"musl": self.musl,
"sgx": self.sgx,
"msvc": self.msvc,
})
}
}