Skip to content

Commit d19e433

Browse files
authored
cpuid-bool: fix SGX support (take 2) (#68)
1 parent 93d93bd commit d19e433

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

cpuid-bool/CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## 0.1.0 (2020-07-14)
99
### Fixed
10-
- SGX target support ([#67])
10+
- SGX target support ([#68])
1111

12-
[#67]: https://github.com/RustCrypto/utils/pull/67
12+
[#68]: https://github.com/RustCrypto/utils/pull/68
1313

1414
## 0.1.0 (2020-06-11)
1515
- Initial release

cpuid-bool/src/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ expand_check_macro! {
9393
macro_rules! cpuid_bool {
9494
($($tf:tt),+ $(,)? ) => {{
9595
// CPUID is not available on SGX targets
96-
#[cfg(not(all(not(target_env = "sgx"), $(target_feature=$tf, )*)))]
96+
#[cfg(all(not(target_env = "sgx"), not(all($(target_feature=$tf, )*))))]
9797
let res = {
9898
#[cfg(target_arch = "x86")]
9999
use core::arch::x86::{__cpuid, __cpuid_count};
@@ -111,6 +111,8 @@ macro_rules! cpuid_bool {
111111
})
112112
};
113113

114+
#[cfg(all(target_env = "sgx", not(all($(target_feature=$tf, )*))))]
115+
let res = false;
114116
#[cfg(all($(target_feature=$tf, )*))]
115117
let res = true;
116118

0 commit comments

Comments
 (0)