platform_info/
lib_impl.rs1#![warn(unused_results)] #[cfg(target_os = "windows")]
6use std::path::Path;
7#[cfg(target_os = "windows")]
8use std::path::PathBuf;
9
10pub type ThreadSafeStdError = dyn std::error::Error + Send + Sync;
14pub type BoxedThreadSafeStdError = Box<ThreadSafeStdError>;
16
17#[cfg(target_os = "windows")]
20type PathStr = Path;
21#[cfg(target_os = "windows")]
24type PathString = PathBuf;
25
26const HOST_OS_NAME: &str = if cfg!(all(
30 target_os = "linux",
31 any(target_env = "gnu", target_env = "")
32)) {
33 "GNU/Linux"
34} else if cfg!(all(
35 target_os = "linux",
36 not(any(target_env = "gnu", target_env = ""))
37)) {
38 "Linux"
39} else if cfg!(target_os = "android") {
40 "Android"
41} else if cfg!(target_os = "windows") {
42 "MS/Windows" } else if cfg!(target_os = "freebsd") {
44 "FreeBSD"
45} else if cfg!(target_os = "netbsd") {
46 "NetBSD"
47} else if cfg!(target_os = "openbsd") {
48 "OpenBSD"
49} else if cfg!(target_vendor = "apple") {
50 "Darwin"
51} else if cfg!(target_os = "fuchsia") {
52 "Fuchsia"
53} else if cfg!(target_os = "redox") {
54 "Redox"
55} else if cfg!(target_os = "illumos") {
56 "illumos"
57} else if cfg!(target_os = "solaris") {
58 "solaris"
59} else {
60 "unknown"
61};
62
63#[cfg(unix)]
66#[path = "platform/unix.rs"]
67mod target;
68#[cfg(windows)]
69#[path = "platform/windows.rs"]
70mod target;
71#[cfg(not(any(unix, windows)))]
72#[path = "platform/unknown.rs"]
73mod target;
74
75pub use target::*;