diff options
| author | Brian Anderson <banderson@mozilla.com> | 2016-09-06 00:41:50 +0000 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2016-09-30 14:02:45 -0700 |
| commit | b8b50f0eda08e19e7c96377681f82ac17c76775d (patch) | |
| tree | 411e10f72395aca9ce8581582f9450681fb384a8 /src/libstd | |
| parent | b2dfeac6907ab63a3261cfa66c04db239d138433 (diff) | |
| download | rust-b8b50f0eda08e19e7c96377681f82ac17c76775d.tar.gz rust-b8b50f0eda08e19e7c96377681f82ac17c76775d.zip | |
Preliminary wasm32 support
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/env.rs | 18 | ||||
| -rw-r--r-- | src/libstd/os/linux/raw.rs | 3 |
2 files changed, 19 insertions, 2 deletions
diff --git a/src/libstd/env.rs b/src/libstd/env.rs index 5171fbdf03e..5da6e5a8b80 100644 --- a/src/libstd/env.rs +++ b/src/libstd/env.rs @@ -892,7 +892,18 @@ mod os { pub const EXE_EXTENSION: &'static str = "pexe"; } -#[cfg(target_os = "emscripten")] +#[cfg(all(target_os = "emscripten", target_arch = "asmjs"))] +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(all(target_os = "emscripten", target_arch = "wasm32"))] mod os { pub const FAMILY: &'static str = "unix"; pub const OS: &'static str = "emscripten"; @@ -969,6 +980,11 @@ mod arch { pub const ARCH: &'static str = "asmjs"; } +#[cfg(target_arch = "wasm32")] +mod arch { + pub const ARCH: &'static str = "wasm32"; +} + #[cfg(test)] mod tests { use super::*; diff --git a/src/libstd/os/linux/raw.rs b/src/libstd/os/linux/raw.rs index 1c19e58818d..e6a95bc831f 100644 --- a/src/libstd/os/linux/raw.rs +++ b/src/libstd/os/linux/raw.rs @@ -34,7 +34,8 @@ pub use self::arch::{off_t, ino_t, nlink_t, blksize_t, blkcnt_t, stat, time_t}; target_arch = "le32", target_arch = "powerpc", target_arch = "arm", - target_arch = "asmjs"))] + target_arch = "asmjs", + target_arch = "wasm32"))] mod arch { use os::raw::{c_long, c_short, c_uint}; |
