1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//! Attributes as values.

#![no_std]

/// Value of `target_os`.
#[cfg(target_os = "windows")]
pub const OS: &str = "windows";
#[cfg(target_os = "linux")]
pub const OS: &str = "linux";
#[cfg(target_os = "macos")]
pub const OS: &str = "macos";
#[cfg(target_os = "ios")]
pub const OS: &str = "ios";
#[cfg(target_os = "android")]
pub const OS: &str = "android";
#[cfg(target_os = "freebsd")]
pub const OS: &str = "freebsd";
#[cfg(target_os = "dragonfly")]
pub const OS: &str = "dragonfly";
#[cfg(target_os = "bitrig")]
pub const OS: &str = "bitrig";
#[cfg(target_os = "openbsd")]
pub const OS: &str = "openbsd";
#[cfg(target_os = "netbsd")]
pub const OS: &str = "netbsd";

/// Value of `target_arch`.
#[cfg(target_arch = "x86")]
pub const ARCH: &str = "x86";
#[cfg(target_arch = "x86_64")]
pub const ARCH: &str = "x86_64";
#[cfg(target_arch = "mips")]
pub const ARCH: &str = "mips";
#[cfg(target_arch = "powerpc")]
pub const ARCH: &str = "powerpc";
#[cfg(target_arch = "powerpc64")]
pub const ARCH: &str = "powerpc64";
#[cfg(target_arch = "arm")]
pub const ARCH: &str = "arm";
#[cfg(target_arch = "aarch64")]
pub const ARCH: &str = "aarch64";

/// Value of `target_family`.
#[cfg(windows)]
pub const FAMILY: &str = "windows";
#[cfg(unix)]
pub const FAMILY: &str = "unix";

/// Value of `target_env`.
#[cfg(target_env = "msvc")]
pub const ENV: &str = "msvc";
#[cfg(target_env = "gnu")]
pub const ENV: &str = "gnu";
#[cfg(target_env = "musl")]
pub const ENV: &str = "musl";

/// Value of `target_endian`.
#[cfg(target_endian = "little")]
pub const ENDIAN: &str = "little";
#[cfg(target_endian = "big")]
pub const ENDIAN: &str = "big";

/// Value of `target_pointer_width`.
#[cfg(target_pointer_width = "32")]
pub const POINTER_WIDTH: u8 = 32;
#[cfg(target_pointer_width = "64")]
pub const POINTER_WIDTH: u8 = 64;

/*
/// Value of `target_vendor`.
#[cfg(target_vendor = "apple")]
pub const VENDOR: &str = "apple";
#[cfg(target_vendor = "pc")]
pub const VENDOR: &str = "pc";
#[cfg(target_vendor = "unknown")]
pub const VENDOR: &str = "unknown";
*/