diff options
| author | Christiaan Dirkx <christiaan@dirkx.email> | 2021-03-02 00:00:04 +0100 |
|---|---|---|
| committer | Christiaan Dirkx <christiaan@dirkx.email> | 2021-03-02 00:00:04 +0100 |
| commit | 7539626c4aea0ff036a8d200c587f8ae2743d9bc (patch) | |
| tree | e8edb75dc5e16dd6a16898ae85621ebc68e415df /library/std/src/sys/unix/ext/mod.rs | |
| parent | 5233edcf1c7ee70ac25e4ec1115c3546f53d8a2d (diff) | |
| download | rust-7539626c4aea0ff036a8d200c587f8ae2743d9bc.tar.gz rust-7539626c4aea0ff036a8d200c587f8ae2743d9bc.zip | |
Move `std::sys::unix::platform` to `std::sys::unix::ext`
Diffstat (limited to 'library/std/src/sys/unix/ext/mod.rs')
| -rw-r--r-- | library/std/src/sys/unix/ext/mod.rs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/library/std/src/sys/unix/ext/mod.rs b/library/std/src/sys/unix/ext/mod.rs index f4354688098..e5048f7e545 100644 --- a/library/std/src/sys/unix/ext/mod.rs +++ b/library/std/src/sys/unix/ext/mod.rs @@ -29,6 +29,42 @@ #![doc(cfg(unix))] #![allow(missing_docs)] +cfg_if::cfg_if! { + if #[cfg(doc)] { + // Use linux as the default platform when documenting on other platforms like Windows + use crate::os::linux as platform; + } else { + #[cfg(target_os = "android")] + use crate::os::android as platform; + #[cfg(target_os = "dragonfly")] + use crate::os::dragonfly as platform; + #[cfg(target_os = "emscripten")] + use crate::os::emscripten as platform; + #[cfg(target_os = "freebsd")] + use crate::os::freebsd as platform; + #[cfg(target_os = "fuchsia")] + use crate::os::fuchsia as platform; + #[cfg(target_os = "haiku")] + use crate::os::haiku as platform; + #[cfg(target_os = "illumos")] + use crate::os::illumos as platform; + #[cfg(target_os = "ios")] + use crate::os::ios as platform; + #[cfg(any(target_os = "linux", target_os = "l4re"))] + use crate::os::linux as platform; + #[cfg(target_os = "macos")] + use crate::os::macos as platform; + #[cfg(target_os = "netbsd")] + use crate::os::netbsd as platform; + #[cfg(target_os = "openbsd")] + use crate::os::openbsd as platform; + #[cfg(target_os = "redox")] + use crate::os::redox as platform; + #[cfg(target_os = "solaris")] + use crate::os::solaris as platform; + } +} + pub mod ffi; pub mod fs; pub mod io; |
