Skip to content

Commit 93d93bd

Browse files
authored
cpuid-bool: fix SGX support (#67)
1 parent 9b269d5 commit 93d93bd

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cpuid-bool/CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## 0.1.0 (2020-07-14)
9+
### Fixed
10+
- SGX target support ([#67])
11+
12+
[#67]: https://github.com/RustCrypto/utils/pull/67
13+
14+
## 0.1.0 (2020-06-11)
15+
- Initial release

cpuid-bool/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cpuid-bool"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
authors = ["RustCrypto Developers"]
55
license = "MIT OR Apache-2.0"
66
description = "A lightweight no-std compatible alternative to is_x86_feature_detected"

cpuid-bool/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ expand_check_macro! {
9292
#[macro_export]
9393
macro_rules! cpuid_bool {
9494
($($tf:tt),+ $(,)? ) => {{
95-
#[cfg(not(all($(target_feature=$tf, )*)))]
95+
// CPUID is not available on SGX targets
96+
#[cfg(not(all(not(target_env = "sgx"), $(target_feature=$tf, )*)))]
9697
let res = {
9798
#[cfg(target_arch = "x86")]
9899
use core::arch::x86::{__cpuid, __cpuid_count};

0 commit comments

Comments
 (0)