nstd_sys/
os.rs

1//! Operating system specific functionality.
2#[cfg(unix)]
3pub mod unix;
4#[cfg(windows)]
5pub mod windows;
6
7/// Constant that is only set if the target operating system is Linux.
8#[cfg(target_os = "linux")]
9pub const NSTD_OS_LINUX: u8 = 1;
10/// Constant that is only set if the target operating system is Linux.
11#[cfg(not(target_os = "linux"))]
12pub const NSTD_OS_LINUX: u8 = 0;
13
14/// Constant that is only set if the target operating system is macOS.
15#[cfg(target_os = "macos")]
16pub const NSTD_OS_MACOS: u8 = 1;
17/// Constant that is only set if the target operating system is macOS.
18#[cfg(not(target_os = "macos"))]
19pub const NSTD_OS_MACOS: u8 = 0;
20
21/// Constant that is only set if the target operating system is Windows.
22#[cfg(windows)]
23pub const NSTD_OS_WINDOWS: u8 = 1;
24/// Constant that is only set if the target operating system is Windows.
25#[cfg(not(windows))]
26pub const NSTD_OS_WINDOWS: u8 = 0;
27
28/// Constant that is only set if the target operating system is iOS.
29#[cfg(target_os = "ios")]
30pub const NSTD_OS_IOS: u8 = 1;
31/// Constant that is only set if the target operating system is iOS.
32#[cfg(not(target_os = "ios"))]
33pub const NSTD_OS_IOS: u8 = 0;
34
35/// Constant that is only set if the target operating system is Android.
36#[cfg(target_os = "android")]
37pub const NSTD_OS_ANDROID: u8 = 1;
38/// Constant that is only set if the target operating system is Android.
39#[cfg(not(target_os = "android"))]
40pub const NSTD_OS_ANDROID: u8 = 0;
41
42/// Constant that is only set if the target operating system is DragonFly BSD.
43#[cfg(target_os = "dragonfly")]
44#[allow(clippy::doc_markdown)]
45pub const NSTD_OS_DRAGONFLY: u8 = 1;
46/// Constant that is only set if the target operating system is DragonFly BSD.
47#[cfg(not(target_os = "dragonfly"))]
48#[allow(clippy::doc_markdown)]
49pub const NSTD_OS_DRAGONFLY: u8 = 0;
50
51/// Constant that is only set if the target operating system is FreeBSD.
52#[cfg(target_os = "freebsd")]
53pub const NSTD_OS_FREEBSD: u8 = 1;
54/// Constant that is only set if the target operating system is FreeBSD.
55#[cfg(not(target_os = "freebsd"))]
56pub const NSTD_OS_FREEBSD: u8 = 0;
57
58/// Constant that is only set if the target operating system is NetBSD.
59#[cfg(target_os = "netbsd")]
60#[allow(clippy::doc_markdown)]
61pub const NSTD_OS_NETBSD: u8 = 1;
62/// Constant that is only set if the target operating system is NetBSD.
63#[cfg(not(target_os = "netbsd"))]
64#[allow(clippy::doc_markdown)]
65pub const NSTD_OS_NETBSD: u8 = 0;
66
67/// Constant that is only set if the target operating system is OpenBSD.
68#[cfg(target_os = "openbsd")]
69#[allow(clippy::doc_markdown)]
70pub const NSTD_OS_OPENBSD: u8 = 1;
71/// Constant that is only set if the target operating system is OpenBSD.
72#[cfg(not(target_os = "openbsd"))]
73#[allow(clippy::doc_markdown)]
74pub const NSTD_OS_OPENBSD: u8 = 0;
75
76/// Constant that is only set if the target operating system is BSD based.
77#[cfg(any(
78    target_os = "dragonfly",
79    target_os = "freebsd",
80    target_os = "netbsd",
81    target_os = "openbsd"
82))]
83pub const NSTD_OS_BSD: u8 = 1;
84/// Constant that is only set if the target operating system is BSD based.
85#[cfg(not(any(
86    target_os = "dragonfly",
87    target_os = "freebsd",
88    target_os = "netbsd",
89    target_os = "openbsd"
90)))]
91pub const NSTD_OS_BSD: u8 = 0;
92
93/// Constant that is only set if the target operating system is Haiku.
94#[cfg(target_os = "haiku")]
95pub const NSTD_OS_HAIKU: u8 = 1;
96/// Constant that is only set if the target operating system is Haiku.
97#[cfg(not(target_os = "haiku"))]
98pub const NSTD_OS_HAIKU: u8 = 0;
99
100/// Constant that is only set if the target operating system is QNX Neutrino.
101#[cfg(target_os = "nto")]
102pub const NSTD_OS_NTO: u8 = 1;
103/// Constant that is only set if the target operating system is QNX Neutrino.
104#[cfg(not(target_os = "nto"))]
105pub const NSTD_OS_NTO: u8 = 0;
106
107/// Constant that is only set if the target operating system is Solaris.
108#[cfg(target_os = "solaris")]
109pub const NSTD_OS_SOLARIS: u8 = 1;
110/// Constant that is only set if the target operating system is Solaris.
111#[cfg(not(target_os = "solaris"))]
112pub const NSTD_OS_SOLARIS: u8 = 0;
113
114/// Constant that is only set if the target operating system is Unix based.
115#[cfg(unix)]
116pub const NSTD_OS_UNIX: u8 = 1;
117/// Constant that is only set if the target operating system is Unix based.
118#[cfg(not(unix))]
119pub const NSTD_OS_UNIX: u8 = 0;