about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-06-07 21:38:25 -0700
committerBrian Anderson <banderson@mozilla.com>2012-06-07 22:28:00 -0700
commit95b9d538b8bda04e222c95d478b97c19d77bb5c6 (patch)
tree819961fab6287b7b174879c1bddff7159487bdc2 /src/libcore
parent7ef825bb607c4e934c92bd0b73ecbc4c24f3286b (diff)
downloadrust-95b9d538b8bda04e222c95d478b97c19d77bb5c6.tar.gz
rust-95b9d538b8bda04e222c95d478b97c19d77bb5c6.zip
Use #[cfg(unix)] and #[cfg(windows)] everywhere
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/cmath.rs12
-rw-r--r--src/libcore/comm.rs6
-rw-r--r--src/libcore/io.rs6
-rw-r--r--src/libcore/iter.rs4
-rw-r--r--src/libcore/os.rs96
-rw-r--r--src/libcore/path.rs22
-rw-r--r--src/libcore/priv.rs2
-rw-r--r--src/libcore/rand.rs4
-rw-r--r--src/libcore/run.rs14
-rw-r--r--src/libcore/str.rs8
-rw-r--r--src/libcore/task.rs12
-rw-r--r--src/libcore/uint-template.rs4
-rw-r--r--src/libcore/vec.rs4
13 files changed, 76 insertions, 118 deletions
diff --git a/src/libcore/cmath.rs b/src/libcore/cmath.rs
index 3af00ea5627..f0b346e32a3 100644
--- a/src/libcore/cmath.rs
+++ b/src/libcore/cmath.rs
@@ -48,12 +48,10 @@ native mod c_double {
     pure fn frexp(n: c_double, &value: c_int) -> c_double;
     pure fn hypot(x: c_double, y: c_double) -> c_double;
     pure fn ldexp(x: c_double, n: c_int) -> c_double;
-    #[cfg(target_os = "linux")]
-    #[cfg(target_os = "macos")]
-    #[cfg(target_os = "freebsd")]
+    #[cfg(unix)]
     #[link_name="lgamma_r"] pure fn lgamma(n: c_double,
                                            &sign: c_int) -> c_double;
-    #[cfg(target_os = "win32")]
+    #[cfg(windows)]
     #[link_name="__lgamma_r"] pure fn lgamma(n: c_double,
                                              &sign: c_int) -> c_double;
     // renamed: log is a reserved keyword; ln seems more natural, too
@@ -131,13 +129,11 @@ native mod c_float {
     #[link_name="hypotf"] pure fn hypot(x: c_float, y: c_float) -> c_float;
     #[link_name="ldexpf"] pure fn ldexp(x: c_float, n: c_int) -> c_float;
 
-    #[cfg(target_os="linux")]
-    #[cfg(target_os="macos")]
-    #[cfg(target_os="freebsd")]
+    #[cfg(unix)]
     #[link_name="lgammaf_r"] pure fn lgamma(n: c_float,
                                             &sign: c_int) -> c_float;
 
-    #[cfg(target_os="win32")]
+    #[cfg(windows)]
     #[link_name="__lgammaf_r"] pure fn lgamma(n: c_float,
                                               &sign: c_int) -> c_float;
 
diff --git a/src/libcore/comm.rs b/src/libcore/comm.rs
index 4f29e7d982a..7836d05c818 100644
--- a/src/libcore/comm.rs
+++ b/src/libcore/comm.rs
@@ -420,7 +420,7 @@ fn test_recv_chan() {
 
 #[test]
 #[should_fail]
-#[ignore(cfg(target_os = "win32"))]
+#[ignore(cfg(windows))]
 fn test_recv_chan_dead() {
     let ch = chan(port());
     send(ch, "flower");
@@ -428,7 +428,7 @@ fn test_recv_chan_dead() {
 }
 
 #[test]
-#[ignore(cfg(target_os = "win32"))]
+#[ignore(cfg(windows))]
 fn test_recv_chan_wrong_task() {
     let po = port();
     let ch = chan(po);
@@ -464,7 +464,7 @@ fn test_listen() {
 }
 
 #[test]
-#[ignore(cfg(target_os="win32"))]
+#[ignore(cfg(windows))]
 fn test_port_detach_fail() {
     iter::repeat(100u) {||
         let builder = task::builder();
diff --git a/src/libcore/io.rs b/src/libcore/io.rs
index b18be417019..077a178546e 100644
--- a/src/libcore/io.rs
+++ b/src/libcore/io.rs
@@ -398,12 +398,10 @@ fn fd_writer(fd: fd_t, cleanup: bool) -> writer {
 fn mk_file_writer(path: str, flags: [fileflag])
     -> result<writer, str> {
 
-    #[cfg(target_os = "win32")]
+    #[cfg(windows)]
     fn wb() -> c_int { (O_WRONLY | O_BINARY) as c_int }
 
-    #[cfg(target_os = "linux")]
-    #[cfg(target_os = "macos")]
-    #[cfg(target_os = "freebsd")]
+    #[cfg(unix)]
     fn wb() -> c_int { O_WRONLY as c_int }
 
     let mut fflags: c_int = wb();
diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs
index 80ccfc1422e..cf903c3bebe 100644
--- a/src/libcore/iter.rs
+++ b/src/libcore/iter.rs
@@ -229,7 +229,7 @@ fn test_min() {
 
 #[test]
 #[should_fail]
-#[ignore(cfg(target_os = "win32"))]
+#[ignore(cfg(windows))]
 fn test_min_empty() {
     min::<int, [int]>([]);
 }
@@ -241,7 +241,7 @@ fn test_max() {
 
 #[test]
 #[should_fail]
-#[ignore(cfg(target_os = "win32"))]
+#[ignore(cfg(windows))]
 fn test_max_empty() {
     max::<int, [int]>([]);
 }
diff --git a/src/libcore/os.rs b/src/libcore/os.rs
index d2d6f48bceb..8ebb946af21 100644
--- a/src/libcore/os.rs
+++ b/src/libcore/os.rs
@@ -79,7 +79,7 @@ fn fill_charp_buf(f: fn(*mut c_char, size_t) -> bool)
     }
 }
 
-#[cfg(target_os = "win32")]
+#[cfg(windows)]
 mod win32 {
     import dword = libc::types::os::arch::extra::DWORD;
 
@@ -200,9 +200,7 @@ mod global_env {
 
     mod impl {
 
-        #[cfg(target_os = "linux")]
-        #[cfg(target_os = "macos")]
-        #[cfg(target_os = "freebsd")]
+        #[cfg(unix)]
         fn getenv(n: str) -> option<str> unsafe {
             let s = str::as_c_str(n, libc::getenv);
             ret if unsafe::reinterpret_cast(s) == 0 {
@@ -213,7 +211,7 @@ mod global_env {
             };
         }
 
-        #[cfg(target_os = "win32")]
+        #[cfg(windows)]
         fn getenv(n: str) -> option<str> unsafe {
             import libc::types::os::arch::extra::*;
             import libc::funcs::extra::kernel32::*;
@@ -226,9 +224,7 @@ mod global_env {
         }
 
 
-        #[cfg(target_os = "linux")]
-        #[cfg(target_os = "macos")]
-        #[cfg(target_os = "freebsd")]
+        #[cfg(unix)]
         fn setenv(n: str, v: str) {
 
             // FIXME: remove this when export globs work properly.
@@ -241,7 +237,7 @@ mod global_env {
         }
 
 
-        #[cfg(target_os = "win32")]
+        #[cfg(windows)]
         fn setenv(n: str, v: str) {
             // FIXME: remove imports when export globs work properly.
             import libc::funcs::extra::kernel32::*;
@@ -265,7 +261,7 @@ fn fdopen(fd: c_int) -> *FILE {
 
 // fsync related
 
-#[cfg(target_os = "win32")]
+#[cfg(windows)]
 fn fsync_fd(fd: c_int, _level: io::fsync::level) -> c_int {
     import libc::funcs::extra::msvcrt::*;
     ret commit(fd);
@@ -305,14 +301,12 @@ fn fsync_fd(fd: c_int, _l: io::fsync::level) -> c_int {
 }
 
 
-#[cfg(target_os = "win32")]
+#[cfg(windows)]
 fn waitpid(pid: pid_t) -> c_int {
     ret rustrt::rust_process_wait(pid);
 }
 
-#[cfg(target_os = "linux")]
-#[cfg(target_os = "freebsd")]
-#[cfg(target_os = "macos")]
+#[cfg(unix)]
 fn waitpid(pid: pid_t) -> c_int {
     import libc::funcs::posix01::wait::*;
     let status = 0 as c_int;
@@ -323,9 +317,7 @@ fn waitpid(pid: pid_t) -> c_int {
 }
 
 
-#[cfg(target_os = "linux")]
-#[cfg(target_os = "freebsd")]
-#[cfg(target_os = "macos")]
+#[cfg(unix)]
 fn pipe() -> {in: c_int, out: c_int} {
     let fds = {mut in: 0 as c_int,
                mut out: 0 as c_int };
@@ -335,7 +327,7 @@ fn pipe() -> {in: c_int, out: c_int} {
 
 
 
-#[cfg(target_os = "win32")]
+#[cfg(windows)]
 fn pipe() -> {in: c_int, out: c_int} {
     // FIXME: remove this when export globs work properly.
     import libc::consts::os::extra::*;
@@ -359,12 +351,10 @@ fn pipe() -> {in: c_int, out: c_int} {
 fn dll_filename(base: str) -> str {
     ret pre() + base + dll_suffix();
 
-    #[cfg(target_os = "macos")]
-    #[cfg(target_os = "linux")]
-    #[cfg(target_os = "freebsd")]
+    #[cfg(unix)]
     fn pre() -> str { "lib" }
 
-    #[cfg(target_os = "win32")]
+    #[cfg(windows)]
     fn pre() -> str { "" }
 }
 
@@ -405,7 +395,7 @@ fn self_exe_path() -> option<path> {
         }
     }
 
-    #[cfg(target_os = "win32")]
+    #[cfg(windows)]
     fn load_self() -> option<path> unsafe {
         // FIXME: remove imports when export globs work properly.
         import libc::types::os::arch::extra::*;
@@ -449,14 +439,12 @@ fn homedir() -> option<path> {
         }
     };
 
-    #[cfg(target_os = "linux")]
-    #[cfg(target_os = "macos")]
-    #[cfg(target_os = "freebsd")]
+    #[cfg(unix)]
     fn secondary() -> option<path> {
         none
     }
 
-    #[cfg(target_os = "win32")]
+    #[cfg(windows)]
     fn secondary() -> option<path> {
         option::chain(getenv("USERPROFILE")) {|p|
             if !str::is_empty(p) {
@@ -536,7 +524,7 @@ fn make_absolute(p: path) -> path {
 fn make_dir(p: path, mode: c_int) -> bool {
     ret mkdir(p, mode);
 
-    #[cfg(target_os = "win32")]
+    #[cfg(windows)]
     fn mkdir(p: path, _mode: c_int) -> bool unsafe {
         // FIXME: remove imports when export globs work properly.
         import libc::types::os::arch::extra::*;
@@ -549,9 +537,7 @@ fn make_dir(p: path, mode: c_int) -> bool {
         }
     }
 
-    #[cfg(target_os = "linux")]
-    #[cfg(target_os = "macos")]
-    #[cfg(target_os = "freebsd")]
+    #[cfg(unix)]
     fn mkdir(p: path, mode: c_int) -> bool {
         as_c_charp(p) {|c|
             libc::mkdir(c, mode as mode_t) == (0 as c_int)
@@ -562,12 +548,10 @@ fn make_dir(p: path, mode: c_int) -> bool {
 #[doc = "Lists the contents of a directory"]
 fn list_dir(p: path) -> [str] {
 
-    #[cfg(target_os = "linux")]
-    #[cfg(target_os = "macos")]
-    #[cfg(target_os = "freebsd")]
+    #[cfg(unix)]
     fn star(p: str) -> str { p }
 
-    #[cfg(target_os = "win32")]
+    #[cfg(windows)]
     fn star(p: str) -> str {
         let pl = str::len(p);
         if pl == 0u || (p[pl - 1u] as char != path::consts::path_sep
@@ -602,7 +586,7 @@ fn list_dir_path(p: path) -> [str] {
 fn remove_dir(p: path) -> bool {
    ret rmdir(p);
 
-    #[cfg(target_os = "win32")]
+    #[cfg(windows)]
     fn rmdir(p: path) -> bool {
         // FIXME: remove imports when export globs work properly.
         import libc::funcs::extra::kernel32::*;
@@ -613,9 +597,7 @@ fn remove_dir(p: path) -> bool {
         };
     }
 
-    #[cfg(target_os = "linux")]
-    #[cfg(target_os = "macos")]
-    #[cfg(target_os = "freebsd")]
+    #[cfg(unix)]
     fn rmdir(p: path) -> bool {
         ret as_c_charp(p) {|buf|
             libc::rmdir(buf) == (0 as c_int)
@@ -626,7 +608,7 @@ fn remove_dir(p: path) -> bool {
 fn change_dir(p: path) -> bool {
     ret chdir(p);
 
-    #[cfg(target_os = "win32")]
+    #[cfg(windows)]
     fn chdir(p: path) -> bool {
         // FIXME: remove imports when export globs work properly.
         import libc::funcs::extra::kernel32::*;
@@ -637,9 +619,7 @@ fn change_dir(p: path) -> bool {
         };
     }
 
-    #[cfg(target_os = "linux")]
-    #[cfg(target_os = "macos")]
-    #[cfg(target_os = "freebsd")]
+    #[cfg(unix)]
     fn chdir(p: path) -> bool {
         ret as_c_charp(p) {|buf|
             libc::chdir(buf) == (0 as c_int)
@@ -651,7 +631,7 @@ fn change_dir(p: path) -> bool {
 fn copy_file(from: path, to: path) -> bool {
     ret do_copy_file(from, to);
 
-    #[cfg(target_os = "win32")]
+    #[cfg(windows)]
     fn do_copy_file(from: path, to: path) -> bool {
         // FIXME: remove imports when export globs work properly.
         import libc::funcs::extra::kernel32::*;
@@ -664,9 +644,7 @@ fn copy_file(from: path, to: path) -> bool {
         }
     }
 
-    #[cfg(target_os = "linux")]
-    #[cfg(target_os = "macos")]
-    #[cfg(target_os = "freebsd")]
+    #[cfg(unix)]
     fn do_copy_file(from: path, to: path) -> bool unsafe {
         let istream = as_c_charp(from) {|fromp|
             as_c_charp("rb") {|modebuf|
@@ -716,7 +694,7 @@ fn copy_file(from: path, to: path) -> bool {
 fn remove_file(p: path) -> bool {
     ret unlink(p);
 
-    #[cfg(target_os = "win32")]
+    #[cfg(windows)]
     fn unlink(p: path) -> bool {
         // FIXME: remove imports when export globs work properly.
         // (similar to Issue #2006)
@@ -728,9 +706,7 @@ fn remove_file(p: path) -> bool {
         };
     }
 
-    #[cfg(target_os = "linux")]
-    #[cfg(target_os = "macos")]
-    #[cfg(target_os = "freebsd")]
+    #[cfg(unix)]
     fn unlink(p: path) -> bool {
         ret as_c_charp(p) {|buf|
             libc::unlink(buf) == (0 as c_int)
@@ -755,12 +731,10 @@ fn set_exit_status(code: int) {
     rustrt::rust_set_exit_status(code as libc::intptr_t);
 }
 
-#[cfg(target_os = "macos")]
-#[cfg(target_os = "linux")]
-#[cfg(target_os = "freebsd")]
+#[cfg(unix)]
 fn family() -> str { "unix" }
 
-#[cfg(target_os = "win32")]
+#[cfg(windows)]
 fn family() -> str { "windows" }
 
 #[cfg(target_os = "macos")]
@@ -824,7 +798,8 @@ mod tests {
     }
 
     #[test]
-    #[ignore(cgf(target_os = "win32"))]
+    #[ignore(cfg(windows))]
+    #[ignore]
     fn test_setenv_overwrite() {
         let n = make_rand_name();
         setenv(n, "1");
@@ -837,7 +812,8 @@ mod tests {
     // Windows GetEnvironmentVariable requires some extra work to make sure
     // the buffer the variable is copied into is the right size
     #[test]
-    #[ignore(cgf(target_os = "win32"))]
+    #[ignore(cfg(windows))]
+    #[ignore]
     fn test_getenv_big() {
         let mut s = "";
         let mut i = 0;
@@ -902,9 +878,7 @@ mod tests {
     }
 
     #[test]
-    #[cfg(target_os = "linux")]
-    #[cfg(target_os = "macos")]
-    #[cfg(target_os = "freebsd")]
+    #[cfg(unix)]
     fn homedir() {
         let oldhome = getenv("HOME");
 
@@ -918,7 +892,7 @@ mod tests {
     }
 
     #[test]
-    #[cfg(target_os = "win32")]
+    #[cfg(windows)]
     fn homedir() {
 
         let oldhome = getenv("HOME");
diff --git a/src/libcore/path.rs b/src/libcore/path.rs
index a771f2b9928..2e62b73063d 100644
--- a/src/libcore/path.rs
+++ b/src/libcore/path.rs
@@ -16,9 +16,7 @@ export normalize;
 #[doc = "A path or fragment of a filesystem path"]
 type path = str;
 
-#[cfg(target_os = "macos")]
-#[cfg(target_os = "freebsd")]
-#[cfg(target_os = "linux")]
+#[cfg(unix)]
 mod consts {
     #[doc = "
     The primary path seperator character for the platform
@@ -34,7 +32,7 @@ mod consts {
     const alt_path_sep: char = '/';
 }
 
-#[cfg(target_os = "win32")]
+#[cfg(windows)]
 mod consts {
     const path_sep: char = '/';
     const alt_path_sep: char = '\\';
@@ -46,14 +44,12 @@ Indicates whether a path is absolute.
 A path is considered absolute if it begins at the filesystem root (\"/\") or,
 on Windows, begins with a drive letter.
 "]
-#[cfg(target_os = "macos")]
-#[cfg(target_os = "freebsd")]
-#[cfg(target_os = "linux")]
+#[cfg(unix)]
 fn path_is_absolute(p: path) -> bool {
     str::char_at(p, 0u) == '/'
 }
 
-#[cfg(target_os = "win32")]
+#[cfg(windows)]
 fn path_is_absolute(p: str) -> bool {
     ret str::char_at(p, 0u) == '/' ||
         str::char_at(p, 1u) == ':'
@@ -271,9 +267,7 @@ fn normalize(p: path) -> path {
         ret t;
     }
 
-    #[cfg(target_os = "linux")]
-    #[cfg(target_os = "macos")]
-    #[cfg(target_os = "freebsd")]
+    #[cfg(unix)]
     fn reabsolute(orig: path, n: path) -> path {
         if path_is_absolute(orig) {
             path_sep() + n
@@ -282,7 +276,7 @@ fn normalize(p: path) -> path {
         }
     }
 
-    #[cfg(target_os = "win32")]
+    #[cfg(windows)]
     fn reabsolute(orig: path, newp: path) -> path {
        if path_is_absolute(orig) && orig[0] == consts::path_sep as u8 {
            str::from_char(consts::path_sep) + newp
@@ -427,7 +421,7 @@ mod tests {
     }
 
     #[test]
-    #[cfg(target_os = "win32")]
+    #[cfg(windows)]
     fn normalize12() {
         let actual = normalize("C:/whatever");
         let expected = "C:/whatever";
@@ -436,7 +430,7 @@ mod tests {
     }
 
     #[test]
-    #[cfg(target_os = "win32")]
+    #[cfg(windows)]
     fn path_is_absolute_win32() {
         assert path_is_absolute("C:/whatever");
     }
diff --git a/src/libcore/priv.rs b/src/libcore/priv.rs
index d43fc27a019..fc1e547ebde 100644
--- a/src/libcore/priv.rs
+++ b/src/libcore/priv.rs
@@ -225,7 +225,7 @@ fn test_weaken_task_stress() unsafe {
 }
 
 #[test]
-#[ignore(cfg(target_os = "win32"))]
+#[ignore(cfg(windows))]
 fn test_weaken_task_fail() unsafe {
     let res = task::try {||
         weaken_task {|_po|
diff --git a/src/libcore/rand.rs b/src/libcore/rand.rs
index 71bd1025d1d..f5e404712b9 100644
--- a/src/libcore/rand.rs
+++ b/src/libcore/rand.rs
@@ -325,7 +325,7 @@ mod tests {
 
     #[test]
     #[should_fail]
-    #[ignore(cfg(target_os = "win32"))]
+    #[ignore(cfg(windows))]
     fn gen_int_from_fail() {
         rand::rng().gen_int_range(5, -2);
     }
@@ -341,7 +341,7 @@ mod tests {
 
     #[test]
     #[should_fail]
-    #[ignore(cfg(target_os = "win32"))]
+    #[ignore(cfg(windows))]
     fn gen_uint_range_fail() {
         rand::rng().gen_uint_range(5u, 2u);
     }
diff --git a/src/libcore/run.rs b/src/libcore/run.rs
index 34ba16844d8..7ffbd24d42f 100644
--- a/src/libcore/run.rs
+++ b/src/libcore/run.rs
@@ -90,9 +90,7 @@ fn with_argv<T>(prog: str, args: [str],
     vec::as_buf(argptrs, cb)
 }
 
-#[cfg(target_os = "macos")]
-#[cfg(target_os = "linux")]
-#[cfg(target_os = "freebsd")]
+#[cfg(unix)]
 fn with_envp<T>(env: option<[(str,str)]>,
                 cb: fn(*c_void) -> T) -> T unsafe {
     // On posixy systems we can pass a char** for envp, which is
@@ -117,7 +115,7 @@ fn with_envp<T>(env: option<[(str,str)]>,
     }
 }
 
-#[cfg(target_os = "win32")]
+#[cfg(windows)]
 fn with_envp<T>(env: option<[(str,str)]>,
                 cb: fn(*c_void) -> T) -> T unsafe {
     // On win32 we pass an "environment block" which is not a char**, but
@@ -278,14 +276,12 @@ fn program_output(prog: str, args: [str]) ->
 fn waitpid(pid: pid_t) -> int {
     ret waitpid_os(pid);
 
-    #[cfg(target_os = "win32")]
+    #[cfg(windows)]
     fn waitpid_os(pid: pid_t) -> int {
         os::waitpid(pid) as int
     }
 
-    #[cfg(target_os = "linux")]
-    #[cfg(target_os = "macos")]
-    #[cfg(target_os = "freebsd")]
+    #[cfg(unix)]
     fn waitpid_os(pid: pid_t) -> int {
         #[cfg(target_os = "linux")]
         fn WIFEXITED(status: i32) -> bool {
@@ -324,7 +320,7 @@ mod tests {
     import io::writer_util;
 
     // Regression test for memory leaks
-    #[ignore(cfg(target_os = "win32"))] // FIXME
+    #[ignore(cfg(windows))] // FIXME
     fn test_leaks() {
         run::run_program("echo", []);
         run::start_program("echo", []);
diff --git a/src/libcore/str.rs b/src/libcore/str.rs
index 6c24b656988..af2062f4b1d 100644
--- a/src/libcore/str.rs
+++ b/src/libcore/str.rs
@@ -1998,7 +1998,7 @@ mod tests {
 
     #[test]
     #[should_fail]
-    #[ignore(cfg(target_os = "win32"))]
+    #[ignore(cfg(windows))]
     fn test_pop_char_fail() {
         let mut data = "";
         let _cc3 = pop_char(data);
@@ -2419,7 +2419,7 @@ mod tests {
 
     #[test]
     #[should_fail]
-    #[ignore(cfg(target_os = "win32"))]
+    #[ignore(cfg(windows))]
     fn test_slice_fail() {
         slice("中华Việt Nam", 0u, 2u);
     }
@@ -2512,7 +2512,7 @@ mod tests {
 
     #[test]
     #[should_fail]
-    #[ignore(cfg(target_os = "win32"))]
+    #[ignore(cfg(windows))]
     fn test_from_bytes_fail() {
         let bb = [0xff_u8, 0xb8_u8, 0xa8_u8,
                   0xe0_u8, 0xb9_u8, 0x84_u8,
@@ -2537,7 +2537,7 @@ mod tests {
     }
 
     #[test]
-    #[ignore(cfg(target_os = "win32"))]
+    #[ignore(cfg(windows))]
     #[should_fail]
     fn test_as_bytes_fail() {
         // Don't double free
diff --git a/src/libcore/task.rs b/src/libcore/task.rs
index f9e70e0fc39..654d0e92bd6 100644
--- a/src/libcore/task.rs
+++ b/src/libcore/task.rs
@@ -605,7 +605,7 @@ fn test_spawn_raw_simple() {
 }
 
 #[test]
-#[ignore(cfg(target_os = "win32"))]
+#[ignore(cfg(windows))]
 fn test_spawn_raw_unsupervise() {
     let opts = {
         supervise: false
@@ -617,7 +617,7 @@ fn test_spawn_raw_unsupervise() {
 }
 
 #[test]
-#[ignore(cfg(target_os = "win32"))]
+#[ignore(cfg(windows))]
 fn test_spawn_raw_notify() {
     let task_po = comm::port();
     let task_ch = comm::chan(task_po);
@@ -674,7 +674,7 @@ fn test_add_wrapper() {
 }
 
 #[test]
-#[ignore(cfg(target_os = "win32"))]
+#[ignore(cfg(windows))]
 fn test_future_result() {
     let buildr = builder();
     let result = future_result(buildr);
@@ -726,7 +726,7 @@ fn test_try_success() {
 }
 
 #[test]
-#[ignore(cfg(target_os = "win32"))]
+#[ignore(cfg(windows))]
 fn test_try_fail() {
     alt try {||
         fail
@@ -738,7 +738,7 @@ fn test_try_fail() {
 
 #[test]
 #[should_fail]
-#[ignore(cfg(target_os = "win32"))]
+#[ignore(cfg(windows))]
 fn test_spawn_sched_no_threads() {
     spawn_sched(manual_threads(0u)) {|| };
 }
@@ -957,7 +957,7 @@ fn test_osmain() {
 }
 
 #[test]
-#[ignore(cfg(target_os = "win32"))]
+#[ignore(cfg(windows))]
 #[should_fail]
 fn test_unkillable() unsafe {
     import comm::methods;
diff --git a/src/libcore/uint-template.rs b/src/libcore/uint-template.rs
index d1d238d298c..1a14ddc1d8f 100644
--- a/src/libcore/uint-template.rs
+++ b/src/libcore/uint-template.rs
@@ -247,14 +247,14 @@ fn test_parse_buf() {
 
 #[test]
 #[should_fail]
-#[ignore(cfg(target_os = "win32"))]
+#[ignore(cfg(windows))]
 fn to_str_radix1() {
     uint::to_str(100u, 1u);
 }
 
 #[test]
 #[should_fail]
-#[ignore(cfg(target_os = "win32"))]
+#[ignore(cfg(windows))]
 fn to_str_radix17() {
     uint::to_str(100u, 17u);
 }
diff --git a/src/libcore/vec.rs b/src/libcore/vec.rs
index 4cfcd6b7517..eef84111875 100644
--- a/src/libcore/vec.rs
+++ b/src/libcore/vec.rs
@@ -2040,7 +2040,7 @@ mod tests {
 
     #[test]
     #[should_fail]
-    #[ignore(cfg(target_os = "win32"))]
+    #[ignore(cfg(windows))]
     fn test_init_empty() {
         init::<int>([]);
     }
@@ -2070,7 +2070,7 @@ mod tests {
 
     #[test]
     #[should_fail]
-    #[ignore(cfg(target_os = "win32"))]
+    #[ignore(cfg(windows))]
     fn test_windowed_() {
         let _x = windowed (0u, [1u,2u,3u,4u,5u,6u]);
     }