about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVadim Chugunov <vadimcn@gmail.com>2014-08-11 16:32:11 -0700
committerVadim Chugunov <vadimcn@gmail.com>2014-08-12 00:10:26 -0700
commit98332b1a06193c4f83fc2613f72273b50b77f2b3 (patch)
tree8f58a1b77eb08e3f0f242b66e5e353479bbd1d26
parent48ee81682a39c0b36b2286b75e5c18995fe3c718 (diff)
downloadrust-98332b1a06193c4f83fc2613f72273b50b77f2b3.tar.gz
rust-98332b1a06193c4f83fc2613f72273b50b77f2b3.zip
Replace all references to "Win32" with "Windows".
For historical reasons, "Win32" has been used in Rust codebase to mean "Windows OS in general".
This is confusing, especially now, that Rust supports Win64 builds.

[breaking-change]
-rw-r--r--src/librustc/back/link.rs14
-rw-r--r--src/librustc/driver/config.rs8
-rw-r--r--src/librustc/metadata/loader.rs6
-rw-r--r--src/librustc/middle/trans/cabi.rs4
-rw-r--r--src/librustc/middle/trans/cabi_x86.rs4
-rw-r--r--src/librustc_back/archive.rs2
-rw-r--r--src/librustc_back/arm.rs2
-rw-r--r--src/librustc_back/mips.rs2
-rw-r--r--src/librustc_back/mipsel.rs2
-rw-r--r--src/librustc_back/rpath.rs6
-rw-r--r--src/librustc_back/x86.rs2
-rw-r--r--src/librustc_back/x86_64.rs2
-rw-r--r--src/libsyntax/abi.rs16
13 files changed, 35 insertions, 35 deletions
diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs
index 7c9844dbe33..f3e130cf768 100644
--- a/src/librustc/back/link.rs
+++ b/src/librustc/back/link.rs
@@ -200,7 +200,7 @@ pub mod write {
             // OSX has -dead_strip, which doesn't rely on ffunction_sections
             // FIXME(#13846) this should be enabled for windows
             let ffunction_sections = sess.targ_cfg.os != abi::OsMacos &&
-                                     sess.targ_cfg.os != abi::OsWin32;
+                                     sess.targ_cfg.os != abi::OsWindows;
             let fdata_sections = ffunction_sections;
 
             let reloc_model = match sess.opts.cg.relocation_model.as_slice() {
@@ -858,7 +858,7 @@ pub fn get_cc_prog(sess: &Session) -> String {
     // instead of hard-coded gcc.
     // For win32, there is no cc command, so we add a condition to make it use gcc.
     match sess.targ_cfg.os {
-        abi::OsWin32 => "gcc",
+        abi::OsWindows => "gcc",
         _ => "cc",
     }.to_string()
 }
@@ -954,7 +954,7 @@ pub fn filename_for_input(sess: &Session,
         }
         config::CrateTypeDylib => {
             let (prefix, suffix) = match sess.targ_cfg.os {
-                abi::OsWin32 => (loader::WIN32_DLL_PREFIX, loader::WIN32_DLL_SUFFIX),
+                abi::OsWindows => (loader::WIN32_DLL_PREFIX, loader::WIN32_DLL_SUFFIX),
                 abi::OsMacos => (loader::MACOS_DLL_PREFIX, loader::MACOS_DLL_SUFFIX),
                 abi::OsLinux => (loader::LINUX_DLL_PREFIX, loader::LINUX_DLL_SUFFIX),
                 abi::OsAndroid => (loader::ANDROID_DLL_PREFIX, loader::ANDROID_DLL_SUFFIX),
@@ -972,7 +972,7 @@ pub fn filename_for_input(sess: &Session,
         }
         config::CrateTypeExecutable => {
             match sess.targ_cfg.os {
-                abi::OsWin32 => out_filename.with_extension("exe"),
+                abi::OsWindows => out_filename.with_extension("exe"),
                 abi::OsMacos |
                 abi::OsLinux |
                 abi::OsAndroid |
@@ -1388,7 +1388,7 @@ fn link_args(cmd: &mut Command,
     // subset we wanted.
     //
     // FIXME(#11937) we should invoke the system linker directly
-    if sess.targ_cfg.os != abi::OsWin32 {
+    if sess.targ_cfg.os != abi::OsWindows {
         cmd.arg("-nodefaultlibs");
     }
 
@@ -1440,7 +1440,7 @@ fn link_args(cmd: &mut Command,
         cmd.arg("-Wl,-dead_strip");
     }
 
-    if sess.targ_cfg.os == abi::OsWin32 {
+    if sess.targ_cfg.os == abi::OsWindows {
         // Make sure that we link to the dynamic libgcc, otherwise cross-module
         // DWARF stack unwinding will not work.
         // This behavior may be overridden by --link-args "-static-libgcc"
@@ -1715,7 +1715,7 @@ fn add_upstream_rust_crates(cmd: &mut Command, sess: &Session,
 
     // Converts a library file-stem into a cc -l argument
     fn unlib<'a>(config: &config::Config, stem: &'a [u8]) -> &'a [u8] {
-        if stem.starts_with("lib".as_bytes()) && config.os != abi::OsWin32 {
+        if stem.starts_with("lib".as_bytes()) && config.os != abi::OsWindows {
             stem.tailn(3)
         } else {
             stem
diff --git a/src/librustc/driver/config.rs b/src/librustc/driver/config.rs
index f4309d9e51b..263bd0f4d92 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::OsWin32 =>     InternedString::new("win32"),
+        abi::OsWindows =>   InternedString::new("win32"),
         abi::OsMacos =>     InternedString::new("macos"),
         abi::OsLinux =>     InternedString::new("linux"),
         abi::OsAndroid =>   InternedString::new("android"),
@@ -410,7 +410,7 @@ pub fn default_configuration(sess: &Session) -> ast::CrateConfig {
     };
 
     let fam = match sess.targ_cfg.os {
-        abi::OsWin32 => InternedString::new("windows"),
+        abi::OsWindows => InternedString::new("windows"),
         _ => InternedString::new("unix")
     };
 
@@ -452,8 +452,8 @@ pub fn get_os(triple: &str) -> Option<abi::Os> {
     None
 }
 static os_names : &'static [(&'static str, abi::Os)] = &[
-    ("mingw32",   abi::OsWin32),
-    ("win32",     abi::OsWin32),
+    ("mingw32",   abi::OsWindows),
+    ("win32",     abi::OsWindows),
     ("darwin",    abi::OsMacos),
     ("android",   abi::OsAndroid),
     ("linux",     abi::OsLinux),
diff --git a/src/librustc/metadata/loader.rs b/src/librustc/metadata/loader.rs
index d2e1fca0da7..cd8ebf5081b 100644
--- a/src/librustc/metadata/loader.rs
+++ b/src/librustc/metadata/loader.rs
@@ -615,7 +615,7 @@ impl<'a> Context<'a> {
     // dynamic libraries
     fn dylibname(&self) -> Option<(&'static str, &'static str)> {
         match self.os {
-            abi::OsWin32 => Some((WIN32_DLL_PREFIX, WIN32_DLL_SUFFIX)),
+            abi::OsWindows => Some((WIN32_DLL_PREFIX, WIN32_DLL_SUFFIX)),
             abi::OsMacos => Some((MACOS_DLL_PREFIX, MACOS_DLL_SUFFIX)),
             abi::OsLinux => Some((LINUX_DLL_PREFIX, LINUX_DLL_SUFFIX)),
             abi::OsAndroid => Some((ANDROID_DLL_PREFIX, ANDROID_DLL_SUFFIX)),
@@ -824,7 +824,7 @@ pub fn meta_section_name(os: abi::Os) -> Option<&'static str> {
     match os {
         abi::OsMacos => Some("__DATA,__note.rustc"),
         abi::OsiOS => Some("__DATA,__note.rustc"),
-        abi::OsWin32 => Some(".note.rustc"),
+        abi::OsWindows => Some(".note.rustc"),
         abi::OsLinux => Some(".note.rustc"),
         abi::OsAndroid => Some(".note.rustc"),
         abi::OsFreebsd => Some(".note.rustc"),
@@ -836,7 +836,7 @@ pub fn read_meta_section_name(os: abi::Os) -> &'static str {
     match os {
         abi::OsMacos => "__note.rustc",
         abi::OsiOS => unreachable!(),
-        abi::OsWin32 => ".note.rustc",
+        abi::OsWindows => ".note.rustc",
         abi::OsLinux => ".note.rustc",
         abi::OsAndroid => ".note.rustc",
         abi::OsFreebsd => ".note.rustc",
diff --git a/src/librustc/middle/trans/cabi.rs b/src/librustc/middle/trans/cabi.rs
index 52461e3fdcb..d419a56ec14 100644
--- a/src/librustc/middle/trans/cabi.rs
+++ b/src/librustc/middle/trans/cabi.rs
@@ -18,7 +18,7 @@ use middle::trans::cabi_arm;
 use middle::trans::cabi_mips;
 use middle::trans::type_::Type;
 use syntax::abi::{X86, X86_64, Arm, Mips, Mipsel};
-use syntax::abi::{OsWin32};
+use syntax::abi::{OsWindows};
 
 #[deriving(Clone, PartialEq)]
 pub enum ArgKind {
@@ -110,7 +110,7 @@ pub fn compute_abi_info(ccx: &CrateContext,
     match ccx.sess().targ_cfg.arch {
         X86 => cabi_x86::compute_abi_info(ccx, atys, rty, ret_def),
         X86_64 =>
-            if ccx.sess().targ_cfg.os == OsWin32 {
+            if ccx.sess().targ_cfg.os == OsWindows {
                 cabi_x86_win64::compute_abi_info(ccx, atys, rty, ret_def)
             } else {
                 cabi_x86_64::compute_abi_info(ccx, atys, rty, ret_def)
diff --git a/src/librustc/middle/trans/cabi_x86.rs b/src/librustc/middle/trans/cabi_x86.rs
index 6bb3d992f50..d9812677d64 100644
--- a/src/librustc/middle/trans/cabi_x86.rs
+++ b/src/librustc/middle/trans/cabi_x86.rs
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 
-use syntax::abi::{OsWin32, OsMacos, OsiOS};
+use syntax::abi::{OsWindows, OsMacos, OsiOS};
 use llvm::*;
 use super::cabi::*;
 use super::common::*;
@@ -36,7 +36,7 @@ pub fn compute_abi_info(ccx: &CrateContext,
 
         enum Strategy { RetValue(Type), RetPointer }
         let strategy = match ccx.sess().targ_cfg.os {
-            OsWin32 | OsMacos | OsiOS => {
+            OsWindows | OsMacos | OsiOS => {
                 match llsize_of_alloc(ccx, rty) {
                     1 => RetValue(Type::i8(ccx)),
                     2 => RetValue(Type::i16(ccx)),
diff --git a/src/librustc_back/archive.rs b/src/librustc_back/archive.rs
index 85e0f2f10d8..6e606f33361 100644
--- a/src/librustc_back/archive.rs
+++ b/src/librustc_back/archive.rs
@@ -98,7 +98,7 @@ fn run_ar(handler: &ErrorHandler, maybe_ar_prog: &Option<String>,
 pub fn find_library(name: &str, os: abi::Os, search_paths: &[Path],
                     handler: &ErrorHandler) -> Path {
     let (osprefix, osext) = match os {
-        abi::OsWin32 => ("", "lib"), _ => ("lib", "a"),
+        abi::OsWindows => ("", "lib"), _ => ("lib", "a"),
     };
     // On Windows, static libraries sometimes show up as libfoo.a and other
     // times show up as foo.lib
diff --git a/src/librustc_back/arm.rs b/src/librustc_back/arm.rs
index 9bb90427e7c..134f7105ea7 100644
--- a/src/librustc_back/arm.rs
+++ b/src/librustc_back/arm.rs
@@ -37,7 +37,7 @@ pub fn get_target_strs(target_triple: String, target_os: abi::Os) -> target_strs
                 -a0:0:64-n32".to_string()
           }
 
-          abi::OsWin32 => {
+          abi::OsWindows => {
             "e-p:32:32:32\
                 -i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64\
                 -f32:32:32-f64:64:64\
diff --git a/src/librustc_back/mips.rs b/src/librustc_back/mips.rs
index 43bf3e8e4af..322f001c31e 100644
--- a/src/librustc_back/mips.rs
+++ b/src/librustc_back/mips.rs
@@ -32,7 +32,7 @@ pub fn get_target_strs(target_triple: String, target_os: abi::Os) -> target_strs
                 -a0:0:64-n32".to_string()
           }
 
-          abi::OsWin32 => {
+          abi::OsWindows => {
             "E-p:32:32:32\
                 -i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64\
                 -f32:32:32-f64:64:64\
diff --git a/src/librustc_back/mipsel.rs b/src/librustc_back/mipsel.rs
index 87f74e72504..e7ce5b0a429 100644
--- a/src/librustc_back/mipsel.rs
+++ b/src/librustc_back/mipsel.rs
@@ -32,7 +32,7 @@ pub fn get_target_strs(target_triple: String, target_os: abi::Os) -> target_strs
                 -a0:0:64-n32".to_string()
           }
 
-          abi::OsWin32 => {
+          abi::OsWindows => {
             "e-p:32:32:32\
                 -i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64\
                 -f32:32:32-f64:64:64\
diff --git a/src/librustc_back/rpath.rs b/src/librustc_back/rpath.rs
index 94d197ad06a..98fdd5a7fd7 100644
--- a/src/librustc_back/rpath.rs
+++ b/src/librustc_back/rpath.rs
@@ -26,7 +26,7 @@ pub struct RPathConfig<'a> {
 pub fn get_rpath_flags(config: RPathConfig) -> Vec<String> {
 
     // No rpath on windows
-    if config.os == abi::OsWin32 {
+    if config.os == abi::OsWindows {
         return Vec::new();
     }
 
@@ -107,14 +107,14 @@ fn get_rpath_relative_to_output(config: &mut RPathConfig,
                                 lib: &Path) -> String {
     use std::os;
 
-    assert!(config.os != abi::OsWin32);
+    assert!(config.os != abi::OsWindows);
 
     // Mac doesn't appear to support $ORIGIN
     let prefix = match config.os {
         abi::OsAndroid | abi::OsLinux | abi::OsFreebsd | abi::OsDragonfly
                           => "$ORIGIN",
         abi::OsMacos => "@loader_path",
-        abi::OsWin32 | abi::OsiOS => unreachable!()
+        abi::OsWindows | abi::OsiOS => unreachable!()
     };
 
     let mut lib = (config.realpath)(&os::make_absolute(lib)).unwrap();
diff --git a/src/librustc_back/x86.rs b/src/librustc_back/x86.rs
index 3c444806e13..21c4fd42474 100644
--- a/src/librustc_back/x86.rs
+++ b/src/librustc_back/x86.rs
@@ -34,7 +34,7 @@ pub fn get_target_strs(target_triple: String, target_os: abi::Os)
                 -n8:16:32".to_string()
           }
 
-          abi::OsWin32 => {
+          abi::OsWindows => {
             "e-p:32:32-f64:64:64-i64:64:64-f80:32:32-n8:16:32".to_string()
           }
 
diff --git a/src/librustc_back/x86_64.rs b/src/librustc_back/x86_64.rs
index b4b5765986b..43c4d646ec9 100644
--- a/src/librustc_back/x86_64.rs
+++ b/src/librustc_back/x86_64.rs
@@ -29,7 +29,7 @@ pub fn get_target_strs(target_triple: String, target_os: abi::Os) -> target_strs
                 s0:64:64-f80:128:128-n8:16:32:64".to_string()
           }
 
-          abi::OsWin32 => {
+          abi::OsWindows => {
             // FIXME: Test this. Copied from linux (#2398)
             "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-\
                 f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-\
diff --git a/src/libsyntax/abi.rs b/src/libsyntax/abi.rs
index c50a5661973..77b0f91f33b 100644
--- a/src/libsyntax/abi.rs
+++ b/src/libsyntax/abi.rs
@@ -11,7 +11,7 @@
 use std::fmt;
 
 #[deriving(PartialEq)]
-pub enum Os { OsWin32, OsMacos, OsLinux, OsAndroid, OsFreebsd, OsiOS,
+pub enum Os { OsWindows, OsMacos, OsLinux, OsAndroid, OsFreebsd, OsiOS,
               OsDragonfly }
 
 #[deriving(PartialEq, Eq, Hash, Encodable, Decodable, Clone)]
@@ -124,7 +124,7 @@ impl Abi {
         // Transform this ABI as appropriate for the requested os/arch
         // combination.
         Some(match (*self, os, arch) {
-            (System, OsWin32, X86) => Stdcall,
+            (System, OsWindows, X86) => Stdcall,
             (System, _, _) => C,
             (me, _, _) => me,
         })
@@ -147,7 +147,7 @@ impl fmt::Show for Os {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         match *self {
             OsLinux => "linux".fmt(f),
-            OsWin32 => "win32".fmt(f),
+            OsWindows => "win32".fmt(f),
             OsMacos => "macos".fmt(f),
             OsiOS => "ios".fmt(f),
             OsAndroid => "android".fmt(f),
@@ -195,9 +195,9 @@ fn pick_uniplatform() {
     assert_eq!(Stdcall.for_target(OsLinux, X86), Some(Stdcall));
     assert_eq!(Stdcall.for_target(OsLinux, Arm), None);
     assert_eq!(System.for_target(OsLinux, X86), Some(C));
-    assert_eq!(System.for_target(OsWin32, X86), Some(Stdcall));
-    assert_eq!(System.for_target(OsWin32, X86_64), Some(C));
-    assert_eq!(System.for_target(OsWin32, Arm), Some(C));
-    assert_eq!(Stdcall.for_target(OsWin32, X86), Some(Stdcall));
-    assert_eq!(Stdcall.for_target(OsWin32, X86_64), Some(Stdcall));
+    assert_eq!(System.for_target(OsWindows, X86), Some(Stdcall));
+    assert_eq!(System.for_target(OsWindows, X86_64), Some(C));
+    assert_eq!(System.for_target(OsWindows, Arm), Some(C));
+    assert_eq!(Stdcall.for_target(OsWindows, X86), Some(Stdcall));
+    assert_eq!(Stdcall.for_target(OsWindows, X86_64), Some(Stdcall));
 }