summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs137
1 files changed, 65 insertions, 72 deletions
diff --git a/src/lib.rs b/src/lib.rs
index c8beeedccd..54f67895a6 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -21,31 +21,45 @@
)]
#![cfg_attr(
all(target_os = "linux", target_arch = "x86_64"),
- doc(html_root_url = "https://rust-lang.github.io/libc/x86_64-unknown-linux-gnu")
+ doc(
+ html_root_url = "https://rust-lang.github.io/libc/x86_64-unknown-linux-gnu"
+ )
)]
#![cfg_attr(
all(target_os = "linux", target_arch = "x86"),
- doc(html_root_url = "https://rust-lang.github.io/libc/i686-unknown-linux-gnu")
+ doc(
+ html_root_url = "https://rust-lang.github.io/libc/i686-unknown-linux-gnu"
+ )
)]
#![cfg_attr(
all(target_os = "linux", target_arch = "arm"),
- doc(html_root_url = "https://rust-lang.github.io/libc/arm-unknown-linux-gnueabihf")
+ doc(
+ html_root_url = "https://rust-lang.github.io/libc/arm-unknown-linux-gnueabihf"
+ )
)]
#![cfg_attr(
all(target_os = "linux", target_arch = "mips"),
- doc(html_root_url = "https://rust-lang.github.io/libc/mips-unknown-linux-gnu")
+ doc(
+ html_root_url = "https://rust-lang.github.io/libc/mips-unknown-linux-gnu"
+ )
)]
#![cfg_attr(
all(target_os = "linux", target_arch = "aarch64"),
- doc(html_root_url = "https://rust-lang.github.io/libc/aarch64-unknown-linux-gnu")
+ doc(
+ html_root_url = "https://rust-lang.github.io/libc/aarch64-unknown-linux-gnu"
+ )
)]
#![cfg_attr(
all(target_os = "linux", target_env = "musl"),
- doc(html_root_url = "https://rust-lang.github.io/libc/x86_64-unknown-linux-musl")
+ doc(
+ html_root_url = "https://rust-lang.github.io/libc/x86_64-unknown-linux-musl"
+ )
)]
#![cfg_attr(
all(target_os = "macos", target_arch = "x86_64"),
- doc(html_root_url = "https://rust-lang.github.io/libc/x86_64-apple-darwin")
+ doc(
+ html_root_url = "https://rust-lang.github.io/libc/x86_64-apple-darwin"
+ )
)]
#![cfg_attr(
all(target_os = "macos", target_arch = "x86"),
@@ -53,59 +67,87 @@
)]
#![cfg_attr(
all(windows, target_arch = "x86_64", target_env = "gnu"),
- doc(html_root_url = "https://rust-lang.github.io/libc/x86_64-pc-windows-gnu")
+ doc(
+ html_root_url = "https://rust-lang.github.io/libc/x86_64-pc-windows-gnu"
+ )
)]
#![cfg_attr(
all(windows, target_arch = "x86", target_env = "gnu"),
- doc(html_root_url = "https://rust-lang.github.io/libc/i686-pc-windows-gnu")
+ doc(
+ html_root_url = "https://rust-lang.github.io/libc/i686-pc-windows-gnu"
+ )
)]
#![cfg_attr(
all(windows, target_arch = "x86_64", target_env = "msvc"),
- doc(html_root_url = "https://rust-lang.github.io/libc/x86_64-pc-windows-msvc")
+ doc(
+ html_root_url = "https://rust-lang.github.io/libc/x86_64-pc-windows-msvc"
+ )
)]
#![cfg_attr(
all(windows, target_arch = "x86", target_env = "msvc"),
- doc(html_root_url = "https://rust-lang.github.io/libc/i686-pc-windows-msvc")
+ doc(
+ html_root_url = "https://rust-lang.github.io/libc/i686-pc-windows-msvc"
+ )
)]
#![cfg_attr(
target_os = "android",
- doc(html_root_url = "https://rust-lang.github.io/libc/arm-linux-androideabi")
+ doc(
+ html_root_url = "https://rust-lang.github.io/libc/arm-linux-androideabi"
+ )
)]
#![cfg_attr(
target_os = "freebsd",
- doc(html_root_url = "https://rust-lang.github.io/libc/x86_64-unknown-freebsd")
+ doc(
+ html_root_url = "https://rust-lang.github.io/libc/x86_64-unknown-freebsd"
+ )
)]
#![cfg_attr(
target_os = "openbsd",
- doc(html_root_url = "https://rust-lang.github.io/libc/x86_64-unknown-openbsd")
+ doc(
+ html_root_url = "https://rust-lang.github.io/libc/x86_64-unknown-openbsd"
+ )
)]
#![cfg_attr(
target_os = "bitrig",
- doc(html_root_url = "https://rust-lang.github.io/libc/x86_64-unknown-bitrig")
+ doc(
+ html_root_url = "https://rust-lang.github.io/libc/x86_64-unknown-bitrig"
+ )
)]
#![cfg_attr(
target_os = "netbsd",
- doc(html_root_url = "https://rust-lang.github.io/libc/x86_64-unknown-netbsd")
+ doc(
+ html_root_url = "https://rust-lang.github.io/libc/x86_64-unknown-netbsd"
+ )
)]
#![cfg_attr(
target_os = "dragonfly",
- doc(html_root_url = "https://rust-lang.github.io/libc/x86_64-unknown-dragonfly")
+ doc(
+ html_root_url = "https://rust-lang.github.io/libc/x86_64-unknown-dragonfly"
+ )
)]
#![cfg_attr(
target_os = "solaris",
- doc(html_root_url = "https://rust-lang.github.io/libc/x86_64-sun-solaris")
+ doc(
+ html_root_url = "https://rust-lang.github.io/libc/x86_64-sun-solaris"
+ )
)]
#![cfg_attr(
all(target_os = "emscripten", target_arch = "asmjs"),
- doc(html_root_url = "https://rust-lang.github.io/libc/asmjs-unknown-emscripten")
+ doc(
+ html_root_url = "https://rust-lang.github.io/libc/asmjs-unknown-emscripten"
+ )
)]
#![cfg_attr(
all(target_os = "emscripten", target_arch = "wasm32"),
- doc(html_root_url = "https://rust-lang.github.io/libc/wasm32-unknown-emscripten")
+ doc(
+ html_root_url = "https://rust-lang.github.io/libc/wasm32-unknown-emscripten"
+ )
)]
#![cfg_attr(
all(target_os = "linux", target_arch = "sparc64"),
- doc(html_root_url = "https://rust-lang.github.io/libc/sparc64-unknown-linux-gnu")
+ doc(
+ html_root_url = "https://rust-lang.github.io/libc/sparc64-unknown-linux-gnu"
+ )
)]
// Attributes needed when building as part of the standard library
#![cfg_attr(feature = "stdbuild", feature(staged_api, cfg_target_vendor))]
@@ -131,76 +173,27 @@ mod dox;
cfg_if! {
if #[cfg(windows)] {
- mod libc;
- pub use libc::*;
-
- mod ctypes;
- pub use ctypes::*;
-
mod windows;
pub use windows::*;
} else if #[cfg(target_os = "redox")] {
- mod libc;
- pub use libc::*;
-
- mod ctypes;
- pub use ctypes::*;
-
mod redox;
pub use redox::*;
} else if #[cfg(target_os = "cloudabi")] {
- mod libc;
- pub use libc::*;
-
- mod ctypes;
- pub use ctypes::*;
-
mod cloudabi;
pub use cloudabi::*;
} else if #[cfg(target_os = "fuchsia")] {
- mod libc;
- pub use libc::*;
-
- mod ctypes;
- pub use ctypes::*;
-
mod fuchsia;
pub use fuchsia::*;
} else if #[cfg(target_os = "switch")] {
- mod ctypes;
- pub use ctypes::*;
-
mod switch;
pub use switch::*;
} else if #[cfg(unix)] {
- mod libc;
- pub use libc::*;
-
- mod ctypes;
- pub use ctypes::*;
-
mod unix;
pub use unix::*;
} else if #[cfg(target_env = "sgx")] {
- mod ctypes;
- pub use ctypes::*;
-
mod sgx;
pub use sgx::*;
- } else if #[cfg(target_os = "emscripten")] {
- mod libc;
- pub use libc::*;
-
- mod ctypes;
- pub use ctypes::*;
- } else if #[cfg(all(target_arch = "wasm32",
- target_env = "unknown"))] {
- // wasm32-unknown-unknown
- } else {
- mod libc;
- pub use libc::*;
-
- mod ctypes;
- pub use ctypes::*;
+ } else {
+ // non-supported targets: empty...
}
}