Skip to content

Complete renaming of "win32" to "windows". #16693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 23, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/compiletest/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ use header;
use procsrv;
use util::logv;
#[cfg(target_os = "windows")]
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
use util;

use std::io::File;
Expand Down Expand Up @@ -819,7 +818,6 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
}).collect::<Vec<String> >();

#[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| {
Expand All @@ -833,7 +831,6 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
}

#[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())
}
Expand Down Expand Up @@ -1251,15 +1248,13 @@ fn make_cmdline(_libpath: &str, prog: &str, args: &[String]) -> String {
}

#[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 = "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))
}
Expand Down
4 changes: 0 additions & 4 deletions src/compiletest/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use common::Config;

#[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
Expand All @@ -36,7 +35,6 @@ pub fn get_os(triple: &str) -> &'static str {
}

#[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
Expand All @@ -50,11 +48,9 @@ pub fn make_new_path(path: &str) -> String {
}

#[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 = "windows")]
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
pub fn path_div() -> &'static str { ";" }

pub fn logv(config: &Config, s: String) {
Expand Down
2 changes: 0 additions & 2 deletions src/etc/mklldeps.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ def run(args):
]

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()

Expand Down
13 changes: 3 additions & 10 deletions src/liblibc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
* sanity while editing, filling-in-details and eliminating duplication) into
* definitions common-to-all (held in modules named c95, c99, posix88, posix01
* and posix08) and definitions that appear only on *some* platforms (named
* 'extra'). This would be things like significant OSX foundation kit, or win32
* 'extra'). This would be things like significant OSX foundation kit, or Windows
* library kernel32.dll, or various fancy glibc, linux or BSD extensions.
*
* In addition to the per-platform 'extra' modules, we define a module of
Expand Down Expand Up @@ -1195,15 +1195,14 @@ pub mod types {
}

#[cfg(target_os = "windows")]
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
pub mod os {
pub mod common {
pub mod posix01 {
use types::os::arch::c95::{c_short, time_t, c_long};
use types::os::arch::extra::{int64, time64_t};
use types::os::arch::posix88::{dev_t, ino_t};

// pub Note: this is the struct called stat64 in win32. Not stat,
// pub Note: this is the struct called stat64 in Windows. Not stat,
// nor stati64.
#[repr(C)]
pub struct stat {
Expand All @@ -1220,7 +1219,7 @@ pub mod types {
pub st_ctime: time64_t,
}

// note that this is called utimbuf64 in win32
// note that this is called utimbuf64 in Windows
#[repr(C)]
pub struct utimbuf {
pub actime: time64_t,
Expand Down Expand Up @@ -1907,7 +1906,6 @@ pub mod consts {
// into this module.

#[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};
Expand Down Expand Up @@ -3992,7 +3990,6 @@ pub mod funcs {
// with the same POSIX functions and types as other platforms.

#[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};
Expand Down Expand Up @@ -4422,7 +4419,6 @@ pub mod funcs {
}

#[cfg(target_os = "windows")]
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
pub mod posix01 {
pub mod stat_ {
}
Expand All @@ -4439,7 +4435,6 @@ pub mod funcs {


#[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")]
Expand Down Expand Up @@ -4578,7 +4573,6 @@ pub mod funcs {


#[cfg(target_os = "windows")]
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
pub mod bsd44 {
}

Expand All @@ -4605,7 +4599,6 @@ pub mod funcs {


#[cfg(target_os = "windows")]
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
pub mod extra {

pub mod kernel32 {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! Blocking win32-based file I/O
//! Blocking Windows-based file I/O

use alloc::arc::Arc;
use libc::{c_int, c_void};
use libc;
use std::c_str::CString;
use std::mem;
use std::os::win32::fill_utf16_buf_and_decode;
use std::os::windows::fill_utf16_buf_and_decode;
use std::ptr;
use std::rt::rtio;
use std::rt::rtio::{IoResult, IoError};
Expand Down
11 changes: 5 additions & 6 deletions src/libnative/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ mod util;
#[path = "file_unix.rs"]
pub mod file;
#[cfg(windows)]
#[path = "file_win32.rs"]
#[path = "file_windows.rs"]
pub mod file;

#[cfg(target_os = "macos")]
Expand All @@ -59,24 +59,23 @@ pub mod file;
pub mod timer;

#[cfg(target_os = "windows")]
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
#[path = "timer_win32.rs"]
#[path = "timer_windows.rs"]
pub mod timer;

#[cfg(unix)]
#[path = "pipe_unix.rs"]
pub mod pipe;

#[cfg(windows)]
#[path = "pipe_win32.rs"]
#[path = "pipe_windows.rs"]
pub mod pipe;

#[cfg(windows)]
#[path = "tty_win32.rs"]
#[path = "tty_windows.rs"]
mod tty;

#[cfg(unix)] #[path = "c_unix.rs"] mod c;
#[cfg(windows)] #[path = "c_win32.rs"] mod c;
#[cfg(windows)] #[path = "c_windows.rs"] mod c;

fn unimpl() -> IoError {
#[cfg(unix)] use libc::ENOSYS as ERROR;
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/libnative/io/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ fn with_envp<T>(env: Option<&[(&CString, &CString)]>,

#[cfg(windows)]
fn with_envp<T>(env: Option<&[(&CString, &CString)]>, cb: |*mut c_void| -> T) -> T {
// On win32 we pass an "environment block" which is not a char**, but
// On Windows we pass an "environment block" which is not a char**, but
// rather a concatenation of null-terminated k=v\0 sequences, with a final
// \0 to terminate.
match env {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! Timers based on win32 WaitableTimers
//! Timers based on Windows WaitableTimers
//!
//! This implementation is meant to be used solely on windows. As with other
//! implementations, there is a worker thread which is doing all the waiting on
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/librustc/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ pub fn get_cc_prog(sess: &Session) -> String {
// In the future, FreeBSD will use clang as default compiler.
// It would be flexible to use cc (system's default C compiler)
// instead of hard-coded gcc.
// For win32, there is no cc command, so we add a condition to make it use gcc.
// For Windows, there is no cc command, so we add a condition to make it use gcc.
match sess.targ_cfg.os {
abi::OsWindows => "gcc",
_ => "cc",
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/trans/adt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ pub fn trans_drop_flag_ptr<'b>(mut bcx: &'b Block<'b>, r: &Repr,
* depending on which case of an enum it is.
*
* To understand the alignment situation, consider `enum E { V64(u64),
* V32(u32, u32) }` on win32. The type has 8-byte alignment to
* V32(u32, u32) }` on Windows. The type has 8-byte alignment to
* accommodate the u64, but `V32(x, y)` would have LLVM type `{i32,
* i32, i32}`, which is 4-byte aligned.
*
Expand Down
4 changes: 1 addition & 3 deletions src/librustdoc/plugins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ impl PluginManager {
}

#[cfg(target_os = "windows")]
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
fn libname(mut n: String) -> String {
n.push_str(".dll");
n
Expand All @@ -86,8 +85,7 @@ fn libname(mut n: String) -> String {
n
}

#[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
#[cfg(not(target_os="windows"), not(target_os="macos"))]
fn libname(n: String) -> String {
let mut i = String::from_str("lib");
i.push_str(n.as_slice());
Expand Down
1 change: 0 additions & 1 deletion src/librustrt/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ mod imp {
#[cfg(target_os = "macos")]
#[cfg(target_os = "ios")]
#[cfg(target_os = "windows")]
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
mod imp {
use core::prelude::*;
use collections::vec::Vec;
Expand Down
1 change: 0 additions & 1 deletion src/librustrt/libunwind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ pub type _Unwind_Exception_Cleanup_Fn =
#[cfg(target_os = "linux")]
#[cfg(target_os = "freebsd")]
#[cfg(target_os = "windows")]
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
#[link(name = "gcc_s")]
extern {}

Expand Down
4 changes: 0 additions & 4 deletions src/librustrt/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ pub unsafe fn record_sp_limit(limit: uint) {
asm!("movq $0, %fs:112" :: "r"(limit) :: "volatile")
}
#[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
Expand Down Expand Up @@ -229,7 +228,6 @@ pub unsafe fn record_sp_limit(limit: uint) {
asm!("movl $0, %gs:48" :: "r"(limit) :: "volatile")
}
#[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"
Expand Down Expand Up @@ -283,7 +281,6 @@ pub unsafe fn get_sp_limit() -> uint {
return limit;
}
#[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");
Expand Down Expand Up @@ -320,7 +317,6 @@ pub unsafe fn get_sp_limit() -> uint {
return limit;
}
#[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");
Expand Down
3 changes: 3 additions & 0 deletions src/librustrt/unwind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,11 @@ pub mod eabi {
use libunwind as uw;
use libc::{c_void, c_int};

#[repr(C)]
struct EXCEPTION_RECORD;
#[repr(C)]
struct CONTEXT;
#[repr(C)]
struct DISPATCHER_CONTEXT;

#[repr(C)]
Expand Down
1 change: 0 additions & 1 deletion src/librustuv/uvll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,6 @@ extern {}
extern {}

#[cfg(target_os = "windows")]
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
#[link(name = "ws2_32")]
#[link(name = "psapi")]
#[link(name = "iphlpapi")]
Expand Down
1 change: 0 additions & 1 deletion src/libstd/dynamic_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ pub mod dl {
}

#[cfg(target_os = "windows")]
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
pub mod dl {
use c_str::ToCStr;
use iter::Iterator;
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ impl IoError {
// libuv maps this error code to EISDIR. we do too. if it is found
// to be incorrect, we can add in some more machinery to only
// return this message when ERROR_INVALID_FUNCTION after certain
// win32 calls.
// Windows calls.
libc::ERROR_INVALID_FUNCTION => (InvalidInput,
"illegal operation on a directory"),

Expand Down
Loading