Skip to content

Commit

Permalink
cpuid-bool: fix SGX support (take 2) (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov committed Jul 14, 2020
1 parent 93d93bd commit d19e433
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cpuid-bool/CHANGELOG.md
Expand Up @@ -7,9 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## 0.1.0 (2020-07-14)
### Fixed
- SGX target support ([#67])
- SGX target support ([#68])

[#67]: https://github.com/RustCrypto/utils/pull/67
[#68]: https://github.com/RustCrypto/utils/pull/68

## 0.1.0 (2020-06-11)
- Initial release
4 changes: 3 additions & 1 deletion cpuid-bool/src/lib.rs
Expand Up @@ -93,7 +93,7 @@ expand_check_macro! {
macro_rules! cpuid_bool {
($($tf:tt),+ $(,)? ) => {{
// CPUID is not available on SGX targets
#[cfg(not(all(not(target_env = "sgx"), $(target_feature=$tf, )*)))]
#[cfg(all(not(target_env = "sgx"), not(all($(target_feature=$tf, )*))))]
let res = {
#[cfg(target_arch = "x86")]
use core::arch::x86::{__cpuid, __cpuid_count};
Expand All @@ -111,6 +111,8 @@ macro_rules! cpuid_bool {
})
};

#[cfg(all(target_env = "sgx", not(all($(target_feature=$tf, )*))))]
let res = false;
#[cfg(all($(target_feature=$tf, )*))]
let res = true;

Expand Down

0 comments on commit d19e433

Please sign in to comment.