1macro_rules! platforms {
2 ($($($platform:expr);* => $module:ident),*) => {
3 $(
4 #[cfg(any($(target_os = $platform),*))]
5 #[cfg_attr(not(any($(target_os = $platform),*)), allow(dead_code))]
6 mod $module;
7
8 #[cfg(any($(target_os = $platform),*))]
9 pub use self::$module::*;
10 )*
11
12 #[cfg(all(feature = "unsupported", not(any($($(target_os = $platform),*),*))))]
13 #[cfg_attr(any($($(target_os = $platform),*),*), allow(dead_code))]
14 mod unsupported;
15
16 #[cfg(all(feature = "unsupported", not(any($($(target_os = $platform),*),*))))]
17 pub use self::unsupported::*;
18
19 pub const SUPPORTED_PLATFORM: bool = cfg!(any($($(target_os = $platform),*),*));
28 }
29}
30
31platforms! {
32 "android"; "linux"; "macos"; "hurd" => linux_macos,
33 "freebsd"; "netbsd" => bsd
34}