]> git.lizzy.rs Git - rust.git/commitdiff
Replace all references to "Win32" with "Windows".
authorVadim Chugunov <vadimcn@gmail.com>
Mon, 11 Aug 2014 23:32:11 +0000 (16:32 -0700)
committerVadim Chugunov <vadimcn@gmail.com>
Tue, 12 Aug 2014 07:10:26 +0000 (00:10 -0700)
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]

13 files changed:
src/librustc/back/link.rs
src/librustc/driver/config.rs
src/librustc/metadata/loader.rs
src/librustc/middle/trans/cabi.rs
src/librustc/middle/trans/cabi_x86.rs
src/librustc_back/archive.rs
src/librustc_back/arm.rs
src/librustc_back/mips.rs
src/librustc_back/mipsel.rs
src/librustc_back/rpath.rs
src/librustc_back/x86.rs
src/librustc_back/x86_64.rs
src/libsyntax/abi.rs

index 7c9844dbe33fb4693616efda8aaa6400786f96a6..f3e130cf768604773e621744d0806c08218e77af 100644 (file)
@@ -200,7 +200,7 @@ pub fn run_passes(sess: &Session,
             // 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
index f4309d9e51b56f7ae14c84349c09fb896aa0fd94..263bd0f4d92d7c2dde3ecdbcb49cde13874c4519 100644 (file)
@@ -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),
index d2e1fca0da75d3cc7c4bec3fc28d05ea21789ab7..cd8ebf5081ba72533dcf6aca8308063ec93f2750 100644 (file)
@@ -615,7 +615,7 @@ fn crate_matches(&mut self, crate_data: &[u8], libpath: &Path) -> bool {
     // 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",
index 52461e3fdcb23d10fc23daf311e5dea74aa69b4f..d419a56ec148e3f7f27d0890bf30068692667c4a 100644 (file)
@@ -18,7 +18,7 @@
 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)
index 6bb3d992f50c627a4745666c2072b4b729ff4694..d9812677d64cbec0975b429be362c21f171b723e 100644 (file)
@@ -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)),
index 85e0f2f10d8dcae4c0f6a0096c1ef696737a3ff5..6e606f3336180380a6c2a08761cbff9f36de06c4 100644 (file)
@@ -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
index 9bb90427e7ccf24127a290115ab18369654a05e2..134f7105ea76eddfc0726814eeaac726d66061a5 100644 (file)
@@ -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\
index 43bf3e8e4af385efeb1ad5b1553f86ce98d8e277..322f001c31e1b9dfb3df084f459f11153147c642 100644 (file)
@@ -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\
index 87f74e72504ac01dec6d411f04466e67355b2e73..e7ce5b0a429bc4023ad1143647af8c19c15cc69a 100644 (file)
@@ -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\
index 94d197ad06a8d23c6e9f84402657400aeb3e797d..98fdd5a7fd7db4dcebe2f0f7e2d72bc1d4b8961f 100644 (file)
@@ -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();
index 3c444806e13e55c45b113b54b2d9f33702053a52..21c4fd424748f2f21dfc0b08ebd158708e573d01 100644 (file)
@@ -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()
           }
 
index b4b5765986bab3b3533bd22fe6b5254984485620..43c4d646ec940c76425c8c3c58990cea90784292 100644 (file)
@@ -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-\
index c50a5661973f5ed69f109388032e13ab01a6f385..77b0f91f33b676919e795647cd8d4264b07ee591 100644 (file)
@@ -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 @@ pub fn for_target(&self, os: Os, arch: Architecture) -> Option<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));
 }