about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVadim Chugunov <vadimcn@gmail.com>2014-08-10 21:26:45 -0700
committerVadim Chugunov <vadimcn@gmail.com>2014-08-12 00:13:43 -0700
commit3dfd12967aed35b7788f7d3c7460b76b76e70b60 (patch)
tree6c28e2873f65ce3bc29edacd4a7e3f2bf4eb5725
parent98332b1a06193c4f83fc2613f72273b50b77f2b3 (diff)
downloadrust-3dfd12967aed35b7788f7d3c7460b76b76e70b60.tar.gz
rust-3dfd12967aed35b7788f7d3c7460b76b76e70b60.zip
Replace #[cfg(target_os = "win32")] with #[cfg(target_os = "windows")]
-rw-r--r--src/compiletest/runtest.rs15
-rw-r--r--src/compiletest/util.rs17
-rw-r--r--src/etc/mklldeps.py4
-rw-r--r--src/liblibc/lib.rs21
-rw-r--r--src/libnative/io/mod.rs3
-rw-r--r--src/librustc/driver/config.rs3
-rw-r--r--src/librustdoc/plugins.rs6
-rw-r--r--src/librustrt/args.rs3
-rw-r--r--src/librustrt/libunwind.rs3
-rw-r--r--src/librustrt/stack.rs12
-rw-r--r--src/librustuv/uvll.rs3
-rw-r--r--src/libstd/dynamic_lib.rs3
-rw-r--r--src/libstd/os.rs5
-rw-r--r--src/libsyntax/abi.rs2
-rw-r--r--src/test/run-pass/dupe-first-attr.rc3
-rw-r--r--src/test/run-pass/intrinsic-alignment.rs3
-rw-r--r--src/test/run-pass/rec-align-u64.rs3
17 files changed, 72 insertions, 37 deletions
diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs
index a9c7673d4dd..940b1f185cf 100644
--- a/src/compiletest/runtest.rs
+++ b/src/compiletest/runtest.rs
@@ -16,7 +16,8 @@ use header::TestProps;
 use header;
 use procsrv;
 use util::logv;
-#[cfg(target_os = "win32")]
+#[cfg(target_os = "windows")]
+#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
 use util;
 
 use std::io::File;
@@ -816,7 +817,8 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
         format!("{}:{}:", testfile.display(), ee.line)
     }).collect::<Vec<String> >();
 
-    #[cfg(target_os = "win32")]
+    #[cfg(target_os = "windows")]
+    #[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
     fn to_lower( s : &str ) -> String {
         let i = s.chars();
         let c : Vec<char> = i.map( |c| {
@@ -829,7 +831,8 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
         String::from_chars(c.as_slice())
     }
 
-    #[cfg(target_os = "win32")]
+    #[cfg(target_os = "windows")]
+    #[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
     fn prefix_matches( line : &str, prefix : &str ) -> bool {
         to_lower(line).as_slice().starts_with(to_lower(prefix).as_slice())
     }
@@ -1246,14 +1249,16 @@ fn make_cmdline(_libpath: &str, prog: &str, args: &[String]) -> String {
     format!("{} {}", prog, args.connect(" "))
 }
 
-#[cfg(target_os = "win32")]
+#[cfg(target_os = "windows")]
+#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
 fn make_cmdline(libpath: &str, prog: &str, args: &[String]) -> String {
     format!("{} {} {}", lib_path_cmd_prefix(libpath), prog, args.connect(" "))
 }
 
 // Build the LD_LIBRARY_PATH variable as it would be seen on the command line
 // for diagnostic purposes
-#[cfg(target_os = "win32")]
+#[cfg(target_os = "windows")]
+#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
 fn lib_path_cmd_prefix(path: &str) -> String {
     format!("{}=\"{}\"", util::lib_path_env_var(), util::make_new_path(path))
 }
diff --git a/src/compiletest/util.rs b/src/compiletest/util.rs
index 445e814a1eb..8947856e332 100644
--- a/src/compiletest/util.rs
+++ b/src/compiletest/util.rs
@@ -10,13 +10,15 @@
 
 use common::Config;
 
-#[cfg(target_os = "win32")]
+#[cfg(target_os = "windows")]
+#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
 use std::os::getenv;
 
 /// Conversion table from triple OS name to Rust SYSNAME
 static OS_TABLE: &'static [(&'static str, &'static str)] = &[
-    ("mingw32", "win32"),
-    ("win32", "win32"),
+    ("mingw32", "windows"),
+    ("win32", "windows"),
+    ("windows", "windows"),
     ("darwin", "macos"),
     ("android", "android"),
     ("linux", "linux"),
@@ -33,7 +35,8 @@ pub fn get_os(triple: &str) -> &'static str {
     fail!("Cannot determine OS from triple");
 }
 
-#[cfg(target_os = "win32")]
+#[cfg(target_os = "windows")]
+#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
 pub fn make_new_path(path: &str) -> String {
 
     // Windows just uses PATH as the library search path, so we have to
@@ -46,10 +49,12 @@ pub fn make_new_path(path: &str) -> String {
     }
 }
 
-#[cfg(target_os = "win32")]
+#[cfg(target_os = "windows")]
+#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
 pub fn lib_path_env_var() -> &'static str { "PATH" }
 
-#[cfg(target_os = "win32")]
+#[cfg(target_os = "windows")]
+#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
 pub fn path_div() -> &'static str { ";" }
 
 pub fn logv(config: &Config, s: String) {
diff --git a/src/etc/mklldeps.py b/src/etc/mklldeps.py
index 113c192ec07..5d0f35fbd60 100644
--- a/src/etc/mklldeps.py
+++ b/src/etc/mklldeps.py
@@ -61,13 +61,15 @@ for llconfig in sys.argv[4:]:
     elif 'android' in os:
         os = 'android'
     elif 'win' in os or 'mingw' in os:
-        os = 'win32'
+        os = 'windows'
     cfg = [
         "target_arch = \"" + arch + "\"",
         "target_os = \"" + os + "\"",
     ]
 
     f.write("#[cfg(" + ', '.join(cfg) + ")]\n")
+    if os == "windows": # NOTE: Remove after snapshot
+        f.write("#[cfg(stage0, target_arch = \"%s\", target_os = \"win32\")]\n" % (arch,))
 
     version = run([llconfig, '--version']).strip()
 
diff --git a/src/liblibc/lib.rs b/src/liblibc/lib.rs
index e368a564415..c005ae71480 100644
--- a/src/liblibc/lib.rs
+++ b/src/liblibc/lib.rs
@@ -1138,7 +1138,8 @@ pub mod types {
         }
     }
 
-    #[cfg(target_os = "win32")]
+    #[cfg(target_os = "windows")]
+    #[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
     pub mod os {
         pub mod common {
             pub mod posix01 {
@@ -1803,7 +1804,8 @@ pub mod consts {
     // Consts tend to vary per OS so we pull their definitions out
     // into this module.
 
-    #[cfg(target_os = "win32")]
+    #[cfg(target_os = "windows")]
+    #[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
     pub mod os {
         pub mod c95 {
             use types::os::arch::c95::{c_int, c_uint};
@@ -3887,7 +3889,8 @@ pub mod funcs {
     // so be careful when trying to write portable code; it won't always work
     // with the same POSIX functions and types as other platforms.
 
-    #[cfg(target_os = "win32")]
+    #[cfg(target_os = "windows")]
+    #[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
     pub mod posix88 {
         pub mod stat_ {
             use types::os::common::posix01::{stat, utimbuf};
@@ -4316,7 +4319,8 @@ pub mod funcs {
         }
     }
 
-    #[cfg(target_os = "win32")]
+    #[cfg(target_os = "windows")]
+    #[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
     pub mod posix01 {
         pub mod stat_ {
         }
@@ -4332,7 +4336,8 @@ pub mod funcs {
     }
 
 
-    #[cfg(target_os = "win32")]
+    #[cfg(target_os = "windows")]
+    #[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
     #[cfg(target_os = "linux")]
     #[cfg(target_os = "android")]
     #[cfg(target_os = "macos")]
@@ -4470,7 +4475,8 @@ pub mod funcs {
     }
 
 
-    #[cfg(target_os = "win32")]
+    #[cfg(target_os = "windows")]
+    #[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
     pub mod bsd44 {
     }
 
@@ -4496,7 +4502,8 @@ pub mod funcs {
     }
 
 
-    #[cfg(target_os = "win32")]
+    #[cfg(target_os = "windows")]
+    #[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
     pub mod extra {
 
         pub mod kernel32 {
diff --git a/src/libnative/io/mod.rs b/src/libnative/io/mod.rs
index db5421481ee..afd818bd7d7 100644
--- a/src/libnative/io/mod.rs
+++ b/src/libnative/io/mod.rs
@@ -58,7 +58,8 @@ pub mod file;
 #[path = "timer_unix.rs"]
 pub mod timer;
 
-#[cfg(target_os = "win32")]
+#[cfg(target_os = "windows")]
+#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
 #[path = "timer_win32.rs"]
 pub mod timer;
 
diff --git a/src/librustc/driver/config.rs b/src/librustc/driver/config.rs
index 263bd0f4d92..33bf1c8b964 100644
--- a/src/librustc/driver/config.rs
+++ b/src/librustc/driver/config.rs
@@ -390,7 +390,7 @@ pub fn default_lib_output() -> CrateType {
 
 pub fn default_configuration(sess: &Session) -> ast::CrateConfig {
     let tos = match sess.targ_cfg.os {
-        abi::OsWindows =>   InternedString::new("win32"),
+        abi::OsWindows =>   InternedString::new("windows"),
         abi::OsMacos =>     InternedString::new("macos"),
         abi::OsLinux =>     InternedString::new("linux"),
         abi::OsAndroid =>   InternedString::new("android"),
@@ -454,6 +454,7 @@ pub fn get_os(triple: &str) -> Option<abi::Os> {
 static os_names : &'static [(&'static str, abi::Os)] = &[
     ("mingw32",   abi::OsWindows),
     ("win32",     abi::OsWindows),
+    ("windows",   abi::OsWindows),
     ("darwin",    abi::OsMacos),
     ("android",   abi::OsAndroid),
     ("linux",     abi::OsLinux),
diff --git a/src/librustdoc/plugins.rs b/src/librustdoc/plugins.rs
index 9ac36665563..c5ac9416fa0 100644
--- a/src/librustdoc/plugins.rs
+++ b/src/librustdoc/plugins.rs
@@ -73,7 +73,8 @@ impl PluginManager {
     }
 }
 
-#[cfg(target_os="win32")]
+#[cfg(target_os = "windows")]
+#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
 fn libname(mut n: String) -> String {
     n.push_str(".dll");
     n
@@ -85,7 +86,8 @@ fn libname(mut n: String) -> String {
     n
 }
 
-#[cfg(not(target_os="win32"), not(target_os="macos"))]
+#[cfg(not(stage0), not(target_os="windows"), not(target_os="macos"))]
+#[cfg(stage0, not(target_os="win32"), not(target_os="macos"))] // NOTE: Remove after snapshot
 fn libname(n: String) -> String {
     let mut i = String::from_str("lib");
     i.push_str(n.as_slice());
diff --git a/src/librustrt/args.rs b/src/librustrt/args.rs
index 531bbe038fc..453a9307579 100644
--- a/src/librustrt/args.rs
+++ b/src/librustrt/args.rs
@@ -147,7 +147,8 @@ mod imp {
 
 #[cfg(target_os = "macos")]
 #[cfg(target_os = "ios")]
-#[cfg(target_os = "win32")]
+#[cfg(target_os = "windows")]
+#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
 mod imp {
     use core::prelude::*;
     use collections::vec::Vec;
diff --git a/src/librustrt/libunwind.rs b/src/librustrt/libunwind.rs
index db6308c10dc..72d78d84aa3 100644
--- a/src/librustrt/libunwind.rs
+++ b/src/librustrt/libunwind.rs
@@ -86,7 +86,8 @@ pub type _Unwind_Exception_Cleanup_Fn =
 
 #[cfg(target_os = "linux")]
 #[cfg(target_os = "freebsd")]
-#[cfg(target_os = "win32")]
+#[cfg(target_os = "windows")]
+#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
 #[link(name = "gcc_s")]
 extern {}
 
diff --git a/src/librustrt/stack.rs b/src/librustrt/stack.rs
index c941107d7e8..772b5da8cd5 100644
--- a/src/librustrt/stack.rs
+++ b/src/librustrt/stack.rs
@@ -199,7 +199,8 @@ pub unsafe fn record_sp_limit(limit: uint) {
     unsafe fn target_record_sp_limit(limit: uint) {
         asm!("movq $0, %fs:112" :: "r"(limit) :: "volatile")
     }
-    #[cfg(target_arch = "x86_64", target_os = "win32")] #[inline(always)]
+    #[cfg(target_arch = "x86_64", target_os = "windows")] #[inline(always)]
+    #[cfg(stage0, target_arch = "x86_64", target_os = "win32")] // NOTE: Remove after snapshot
     unsafe fn target_record_sp_limit(limit: uint) {
         // see: http://en.wikipedia.org/wiki/Win32_Thread_Information_Block
         // store this inside of the "arbitrary data slot", but double the size
@@ -227,7 +228,8 @@ pub unsafe fn record_sp_limit(limit: uint) {
     unsafe fn target_record_sp_limit(limit: uint) {
         asm!("movl $0, %gs:48" :: "r"(limit) :: "volatile")
     }
-    #[cfg(target_arch = "x86", target_os = "win32")] #[inline(always)]
+    #[cfg(target_arch = "x86", target_os = "windows")] #[inline(always)]
+    #[cfg(stage0, target_arch = "x86", target_os = "win32")] // NOTE: Remove after snapshot
     unsafe fn target_record_sp_limit(limit: uint) {
         // see: http://en.wikipedia.org/wiki/Win32_Thread_Information_Block
         // store this inside of the "arbitrary data slot"
@@ -280,7 +282,8 @@ pub unsafe fn get_sp_limit() -> uint {
         asm!("movq %fs:112, $0" : "=r"(limit) ::: "volatile");
         return limit;
     }
-    #[cfg(target_arch = "x86_64", target_os = "win32")] #[inline(always)]
+    #[cfg(target_arch = "x86_64", target_os = "windows")] #[inline(always)]
+    #[cfg(stage0, target_arch = "x86_64", target_os = "win32")] // NOTE: Remove after snapshot
     unsafe fn target_get_sp_limit() -> uint {
         let limit;
         asm!("movq %gs:0x28, $0" : "=r"(limit) ::: "volatile");
@@ -316,7 +319,8 @@ pub unsafe fn get_sp_limit() -> uint {
         asm!("movl %gs:48, $0" : "=r"(limit) ::: "volatile");
         return limit;
     }
-    #[cfg(target_arch = "x86", target_os = "win32")] #[inline(always)]
+    #[cfg(target_arch = "x86", target_os = "windows")] #[inline(always)]
+    #[cfg(stage0, target_arch = "x86", target_os = "win32")] // NOTE: Remove after snapshot
     unsafe fn target_get_sp_limit() -> uint {
         let limit;
         asm!("movl %fs:0x14, $0" : "=r"(limit) ::: "volatile");
diff --git a/src/librustuv/uvll.rs b/src/librustuv/uvll.rs
index 2bcd2101d89..81114dccb62 100644
--- a/src/librustuv/uvll.rs
+++ b/src/librustuv/uvll.rs
@@ -723,7 +723,8 @@ extern {}
 #[link(name = "rt")]
 extern {}
 
-#[cfg(target_os = "win32")]
+#[cfg(target_os = "windows")]
+#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
 #[link(name = "ws2_32")]
 #[link(name = "psapi")]
 #[link(name = "iphlpapi")]
diff --git a/src/libstd/dynamic_lib.rs b/src/libstd/dynamic_lib.rs
index 1ac37458e24..c1e8fd8832a 100644
--- a/src/libstd/dynamic_lib.rs
+++ b/src/libstd/dynamic_lib.rs
@@ -278,7 +278,8 @@ pub mod dl {
     }
 }
 
-#[cfg(target_os = "win32")]
+#[cfg(target_os = "windows")]
+#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
 pub mod dl {
     use c_str::ToCStr;
     use iter::Iterator;
diff --git a/src/libstd/os.rs b/src/libstd/os.rs
index 85445e49139..7a3991b5696 100644
--- a/src/libstd/os.rs
+++ b/src/libstd/os.rs
@@ -1842,7 +1842,8 @@ pub mod consts {
     pub static EXE_EXTENSION: &'static str = "";
 }
 
-#[cfg(target_os = "win32")]
+#[cfg(target_os = "windows")]
+#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
 pub mod consts {
     pub use os::arch_consts::ARCH;
 
@@ -1850,7 +1851,7 @@ pub mod consts {
 
     /// A string describing the specific operating system in use: in this
     /// case, `win32`.
-    pub static SYSNAME: &'static str = "win32";
+    pub static SYSNAME: &'static str = "windows";
 
     /// Specifies the filename prefix used for shared libraries on this
     /// platform: in this case, the empty string.
diff --git a/src/libsyntax/abi.rs b/src/libsyntax/abi.rs
index 77b0f91f33b..3280829f958 100644
--- a/src/libsyntax/abi.rs
+++ b/src/libsyntax/abi.rs
@@ -147,7 +147,7 @@ impl fmt::Show for Os {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         match *self {
             OsLinux => "linux".fmt(f),
-            OsWindows => "win32".fmt(f),
+            OsWindows => "windows".fmt(f),
             OsMacos => "macos".fmt(f),
             OsiOS => "ios".fmt(f),
             OsAndroid => "android".fmt(f),
diff --git a/src/test/run-pass/dupe-first-attr.rc b/src/test/run-pass/dupe-first-attr.rc
index 76dedaba40f..cb99f90bea8 100644
--- a/src/test/run-pass/dupe-first-attr.rc
+++ b/src/test/run-pass/dupe-first-attr.rc
@@ -17,7 +17,8 @@ mod hello;
 #[cfg(target_os = "macos")]
 mod hello;
 
-#[cfg(target_os = "win32")]
+#[cfg(target_os = "windows")]
+#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
 mod hello;
 
 #[cfg(target_os = "freebsd")]
diff --git a/src/test/run-pass/intrinsic-alignment.rs b/src/test/run-pass/intrinsic-alignment.rs
index edf5068184a..f8110ad7975 100644
--- a/src/test/run-pass/intrinsic-alignment.rs
+++ b/src/test/run-pass/intrinsic-alignment.rs
@@ -42,7 +42,8 @@ mod m {
     }
 }
 
-#[cfg(target_os = "win32")]
+#[cfg(target_os = "windows")]
+#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
 mod m {
     #[main]
     #[cfg(target_arch = "x86")]
diff --git a/src/test/run-pass/rec-align-u64.rs b/src/test/run-pass/rec-align-u64.rs
index 5c484dec445..f9a496feb6c 100644
--- a/src/test/run-pass/rec-align-u64.rs
+++ b/src/test/run-pass/rec-align-u64.rs
@@ -55,7 +55,8 @@ mod m {
     }
 }
 
-#[cfg(target_os = "win32")]
+#[cfg(target_os = "windows")]
+#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
 mod m {
     #[cfg(target_arch = "x86")]
     pub mod m {