X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibstd%2Fenv.rs;h=f7e13a35e9e502ea57422bdcd70c2d51eb7eb86c;hb=a70ae2ffb9a5dd08d916b9938eeca820486ba7a0;hp=db136190082b9b4bfed5c2c5ea3553dcbd9a2276;hpb=4bb9d453cf9640b08d97543cd5ed9ded52fd757f;p=rust.git diff --git a/src/libstd/env.rs b/src/libstd/env.rs index db136190082..f7e13a35e9e 100644 --- a/src/libstd/env.rs +++ b/src/libstd/env.rs @@ -528,13 +528,13 @@ pub struct ArgsOs { inner: os_imp::Args } /// via the command line). /// /// The first element is traditionally the path to the executable, but it can be -/// set to arbitrary text, and it may not even exist, so this property should +/// set to arbitrary text, and may not even exist. This means this property should /// not be relied upon for security purposes. /// /// # Panics /// /// The returned iterator will panic during iteration if any argument to the -/// process is not valid unicode. If this is not desired it is recommended to +/// process is not valid unicode. If this is not desired, /// use the `args_os` function instead. /// /// # Examples @@ -603,7 +603,7 @@ fn len(&self) -> usize { self.inner.len() } /// Constants associated with the current target #[stable(feature = "env", since = "1.0.0")] pub mod consts { - /// A string describing the architecture of the CPU that this is currently + /// A string describing the architecture of the CPU that is currently /// in use. /// /// Some possible values: @@ -613,10 +613,8 @@ pub mod consts { /// - arm /// - aarch64 /// - mips - /// - mipsel /// - powerpc /// - powerpc64 - /// - powerpc64le #[stable(feature = "env", since = "1.0.0")] pub const ARCH: &'static str = super::arch::ARCH; @@ -642,6 +640,7 @@ pub mod consts { /// - bitrig /// - netbsd /// - openbsd + /// - solaris /// - android /// - windows #[stable(feature = "env", since = "1.0.0")] @@ -802,6 +801,17 @@ mod os { pub const EXE_EXTENSION: &'static str = ""; } +#[cfg(target_os = "solaris")] +mod os { + pub const FAMILY: &'static str = "unix"; + pub const OS: &'static str = "solaris"; + pub const DLL_PREFIX: &'static str = "lib"; + pub const DLL_SUFFIX: &'static str = ".so"; + pub const DLL_EXTENSION: &'static str = "so"; + pub const EXE_SUFFIX: &'static str = ""; + pub const EXE_EXTENSION: &'static str = ""; +} + #[cfg(target_os = "windows")] mod os { pub const FAMILY: &'static str = "windows"; @@ -834,6 +844,17 @@ mod os { pub const EXE_EXTENSION: &'static str = "pexe"; } +#[cfg(target_os = "emscripten")] +mod os { + pub const FAMILY: &'static str = "unix"; + pub const OS: &'static str = "emscripten"; + pub const DLL_PREFIX: &'static str = "lib"; + pub const DLL_SUFFIX: &'static str = ".so"; + pub const DLL_EXTENSION: &'static str = "so"; + pub const EXE_SUFFIX: &'static str = ".js"; + pub const EXE_EXTENSION: &'static str = "js"; +} + #[cfg(target_arch = "x86")] mod arch { pub const ARCH: &'static str = "x86"; @@ -859,11 +880,6 @@ mod arch { pub const ARCH: &'static str = "mips"; } -#[cfg(target_arch = "mipsel")] -mod arch { - pub const ARCH: &'static str = "mipsel"; -} - #[cfg(target_arch = "powerpc")] mod arch { pub const ARCH: &'static str = "powerpc"; @@ -874,14 +890,14 @@ mod arch { pub const ARCH: &'static str = "powerpc64"; } -#[cfg(target_arch = "powerpc64le")] +#[cfg(target_arch = "le32")] mod arch { - pub const ARCH: &'static str = "powerpc64le"; + pub const ARCH: &'static str = "le32"; } -#[cfg(target_arch = "le32")] +#[cfg(target_arch = "asmjs")] mod arch { - pub const ARCH: &'static str = "le32"; + pub const ARCH: &'static str = "asmjs"; } #[cfg(test)]