1 | #![allow (dead_code)] |
2 | |
3 | use cfg_if::cfg_if; |
4 | |
5 | // Export the macros for all supported architectures. |
6 | #[macro_use ] |
7 | mod x86; |
8 | #[macro_use ] |
9 | mod arm; |
10 | #[macro_use ] |
11 | mod aarch64; |
12 | #[macro_use ] |
13 | mod riscv; |
14 | #[macro_use ] |
15 | mod powerpc; |
16 | #[macro_use ] |
17 | mod powerpc64; |
18 | #[macro_use ] |
19 | mod mips; |
20 | #[macro_use ] |
21 | mod mips64; |
22 | |
23 | cfg_if! { |
24 | if #[cfg(any(target_arch = "x86" , target_arch = "x86_64" ))] { |
25 | pub use x86::*; |
26 | } else if #[cfg(target_arch = "arm" )] { |
27 | pub use arm::*; |
28 | } else if #[cfg(target_arch = "aarch64" )] { |
29 | pub use aarch64::*; |
30 | } else if #[cfg(any(target_arch = "riscv32" , target_arch = "riscv64" ))] { |
31 | pub use riscv::*; |
32 | } else if #[cfg(target_arch = "powerpc" )] { |
33 | pub use powerpc::*; |
34 | } else if #[cfg(target_arch = "powerpc64" )] { |
35 | pub use powerpc64::*; |
36 | } else if #[cfg(target_arch = "mips" )] { |
37 | pub use mips::*; |
38 | } else if #[cfg(target_arch = "mips64" )] { |
39 | pub use mips64::*; |
40 | } else { |
41 | // Unimplemented architecture: |
42 | #[doc(hidden)] |
43 | pub(crate) enum Feature { |
44 | Null |
45 | } |
46 | #[doc(hidden)] |
47 | pub mod __is_feature_detected {} |
48 | |
49 | impl Feature { |
50 | #[doc(hidden)] |
51 | pub(crate) fn from_str(_s: &str) -> Result<Feature, ()> { Err(()) } |
52 | #[doc(hidden)] |
53 | pub(crate) fn to_str(self) -> &'static str { "" } |
54 | } |
55 | } |
56 | } |
57 | |