Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpuid-bool: fix SGX support (take 2) #68

Merged
merged 1 commit into from Jul 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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