Complete renaming of win32 to windows
This commit is contained in:
parent
8c994a1237
commit
68811817f7
@ -64,7 +64,7 @@
|
|||||||
* sanity while editing, filling-in-details and eliminating duplication) into
|
* sanity while editing, filling-in-details and eliminating duplication) into
|
||||||
* definitions common-to-all (held in modules named c95, c99, posix88, posix01
|
* definitions common-to-all (held in modules named c95, c99, posix88, posix01
|
||||||
* and posix08) and definitions that appear only on *some* platforms (named
|
* 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.
|
* library kernel32.dll, or various fancy glibc, linux or BSD extensions.
|
||||||
*
|
*
|
||||||
* In addition to the per-platform 'extra' modules, we define a module of
|
* In addition to the per-platform 'extra' modules, we define a module of
|
||||||
@ -1195,7 +1195,6 @@ pub mod types {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
|
|
||||||
pub mod os {
|
pub mod os {
|
||||||
pub mod common {
|
pub mod common {
|
||||||
pub mod posix01 {
|
pub mod posix01 {
|
||||||
@ -1203,7 +1202,7 @@ pub mod types {
|
|||||||
use types::os::arch::extra::{int64, time64_t};
|
use types::os::arch::extra::{int64, time64_t};
|
||||||
use types::os::arch::posix88::{dev_t, ino_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.
|
// nor stati64.
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct stat {
|
pub struct stat {
|
||||||
@ -1220,7 +1219,7 @@ pub mod types {
|
|||||||
pub st_ctime: time64_t,
|
pub st_ctime: time64_t,
|
||||||
}
|
}
|
||||||
|
|
||||||
// note that this is called utimbuf64 in win32
|
// note that this is called utimbuf64 in Windows
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct utimbuf {
|
pub struct utimbuf {
|
||||||
pub actime: time64_t,
|
pub actime: time64_t,
|
||||||
@ -1907,7 +1906,6 @@ pub mod consts {
|
|||||||
// into this module.
|
// into this module.
|
||||||
|
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
|
|
||||||
pub mod os {
|
pub mod os {
|
||||||
pub mod c95 {
|
pub mod c95 {
|
||||||
use types::os::arch::c95::{c_int, c_uint};
|
use types::os::arch::c95::{c_int, c_uint};
|
||||||
@ -3992,7 +3990,6 @@ pub mod funcs {
|
|||||||
// with the same POSIX functions and types as other platforms.
|
// with the same POSIX functions and types as other platforms.
|
||||||
|
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
|
|
||||||
pub mod posix88 {
|
pub mod posix88 {
|
||||||
pub mod stat_ {
|
pub mod stat_ {
|
||||||
use types::os::common::posix01::{stat, utimbuf};
|
use types::os::common::posix01::{stat, utimbuf};
|
||||||
@ -4422,7 +4419,6 @@ pub mod funcs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
|
|
||||||
pub mod posix01 {
|
pub mod posix01 {
|
||||||
pub mod stat_ {
|
pub mod stat_ {
|
||||||
}
|
}
|
||||||
@ -4439,7 +4435,6 @@ pub mod funcs {
|
|||||||
|
|
||||||
|
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
|
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
#[cfg(target_os = "android")]
|
#[cfg(target_os = "android")]
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
@ -4578,7 +4573,6 @@ pub mod funcs {
|
|||||||
|
|
||||||
|
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
|
|
||||||
pub mod bsd44 {
|
pub mod bsd44 {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4605,7 +4599,6 @@ pub mod funcs {
|
|||||||
|
|
||||||
|
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
|
|
||||||
pub mod extra {
|
pub mod extra {
|
||||||
|
|
||||||
pub mod kernel32 {
|
pub mod kernel32 {
|
||||||
|
@ -8,14 +8,14 @@
|
|||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
//! Blocking win32-based file I/O
|
//! Blocking Windows-based file I/O
|
||||||
|
|
||||||
use alloc::arc::Arc;
|
use alloc::arc::Arc;
|
||||||
use libc::{c_int, c_void};
|
use libc::{c_int, c_void};
|
||||||
use libc;
|
use libc;
|
||||||
use std::c_str::CString;
|
use std::c_str::CString;
|
||||||
use std::mem;
|
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::ptr;
|
||||||
use std::rt::rtio;
|
use std::rt::rtio;
|
||||||
use std::rt::rtio::{IoResult, IoError};
|
use std::rt::rtio::{IoResult, IoError};
|
@ -46,7 +46,7 @@ mod util;
|
|||||||
#[path = "file_unix.rs"]
|
#[path = "file_unix.rs"]
|
||||||
pub mod file;
|
pub mod file;
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
#[path = "file_win32.rs"]
|
#[path = "file_windows.rs"]
|
||||||
pub mod file;
|
pub mod file;
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
@ -59,8 +59,7 @@ pub mod file;
|
|||||||
pub mod timer;
|
pub mod timer;
|
||||||
|
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
|
#[path = "timer_windows.rs"]
|
||||||
#[path = "timer_win32.rs"]
|
|
||||||
pub mod timer;
|
pub mod timer;
|
||||||
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
@ -68,15 +67,15 @@ pub mod timer;
|
|||||||
pub mod pipe;
|
pub mod pipe;
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
#[path = "pipe_win32.rs"]
|
#[path = "pipe_windows.rs"]
|
||||||
pub mod pipe;
|
pub mod pipe;
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
#[path = "tty_win32.rs"]
|
#[path = "tty_windows.rs"]
|
||||||
mod tty;
|
mod tty;
|
||||||
|
|
||||||
#[cfg(unix)] #[path = "c_unix.rs"] mod c;
|
#[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 {
|
fn unimpl() -> IoError {
|
||||||
#[cfg(unix)] use libc::ENOSYS as ERROR;
|
#[cfg(unix)] use libc::ENOSYS as ERROR;
|
||||||
|
@ -786,7 +786,7 @@ fn with_envp<T>(env: Option<&[(&CString, &CString)]>,
|
|||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
fn with_envp<T>(env: Option<&[(&CString, &CString)]>, cb: |*mut c_void| -> T) -> T {
|
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
|
// rather a concatenation of null-terminated k=v\0 sequences, with a final
|
||||||
// \0 to terminate.
|
// \0 to terminate.
|
||||||
match env {
|
match env {
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// 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
|
//! 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
|
//! implementations, there is a worker thread which is doing all the waiting on
|
@ -856,7 +856,7 @@ pub fn get_cc_prog(sess: &Session) -> String {
|
|||||||
// In the future, FreeBSD will use clang as default compiler.
|
// In the future, FreeBSD will use clang as default compiler.
|
||||||
// It would be flexible to use cc (system's default C compiler)
|
// It would be flexible to use cc (system's default C compiler)
|
||||||
// instead of hard-coded gcc.
|
// 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 {
|
match sess.targ_cfg.os {
|
||||||
abi::OsWindows => "gcc",
|
abi::OsWindows => "gcc",
|
||||||
_ => "cc",
|
_ => "cc",
|
||||||
|
@ -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.
|
* depending on which case of an enum it is.
|
||||||
*
|
*
|
||||||
* To understand the alignment situation, consider `enum E { V64(u64),
|
* 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,
|
* accommodate the u64, but `V32(x, y)` would have LLVM type `{i32,
|
||||||
* i32, i32}`, which is 4-byte aligned.
|
* i32, i32}`, which is 4-byte aligned.
|
||||||
*
|
*
|
||||||
|
@ -348,7 +348,7 @@ impl IoError {
|
|||||||
// libuv maps this error code to EISDIR. we do too. if it is found
|
// 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
|
// to be incorrect, we can add in some more machinery to only
|
||||||
// return this message when ERROR_INVALID_FUNCTION after certain
|
// return this message when ERROR_INVALID_FUNCTION after certain
|
||||||
// win32 calls.
|
// Windows calls.
|
||||||
libc::ERROR_INVALID_FUNCTION => (InvalidInput,
|
libc::ERROR_INVALID_FUNCTION => (InvalidInput,
|
||||||
"illegal operation on a directory"),
|
"illegal operation on a directory"),
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ pub fn getcwd() -> Path {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
pub mod win32 {
|
pub mod windows {
|
||||||
use libc::types::os::arch::extra::DWORD;
|
use libc::types::os::arch::extra::DWORD;
|
||||||
use libc;
|
use libc;
|
||||||
use option::{None, Option};
|
use option::{None, Option};
|
||||||
@ -362,7 +362,7 @@ pub fn getenv_as_bytes(n: &str) -> Option<Vec<u8>> {
|
|||||||
pub fn getenv(n: &str) -> Option<String> {
|
pub fn getenv(n: &str) -> Option<String> {
|
||||||
unsafe {
|
unsafe {
|
||||||
with_env_lock(|| {
|
with_env_lock(|| {
|
||||||
use os::win32::{fill_utf16_buf_and_decode};
|
use os::windows::{fill_utf16_buf_and_decode};
|
||||||
let n: Vec<u16> = n.utf16_units().collect();
|
let n: Vec<u16> = n.utf16_units().collect();
|
||||||
let n = n.append_one(0);
|
let n = n.append_one(0);
|
||||||
fill_utf16_buf_and_decode(|buf, sz| {
|
fill_utf16_buf_and_decode(|buf, sz| {
|
||||||
@ -707,7 +707,7 @@ pub fn self_exe_name() -> Option<Path> {
|
|||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
fn load_self() -> Option<Vec<u8>> {
|
fn load_self() -> Option<Vec<u8>> {
|
||||||
unsafe {
|
unsafe {
|
||||||
use os::win32::fill_utf16_buf_and_decode;
|
use os::windows::fill_utf16_buf_and_decode;
|
||||||
fill_utf16_buf_and_decode(|buf, sz| {
|
fill_utf16_buf_and_decode(|buf, sz| {
|
||||||
libc::GetModuleFileNameW(0u as libc::DWORD, buf, sz)
|
libc::GetModuleFileNameW(0u as libc::DWORD, buf, sz)
|
||||||
}).map(|s| s.into_string().into_bytes())
|
}).map(|s| s.into_string().into_bytes())
|
||||||
@ -1315,7 +1315,7 @@ pub fn page_size() -> uint {
|
|||||||
|
|
||||||
/// A memory mapped file or chunk of memory. This is a very system-specific
|
/// A memory mapped file or chunk of memory. This is a very system-specific
|
||||||
/// interface to the OS's memory mapping facilities (`mmap` on POSIX,
|
/// interface to the OS's memory mapping facilities (`mmap` on POSIX,
|
||||||
/// `VirtualAlloc`/`CreateFileMapping` on win32). It makes no attempt at
|
/// `VirtualAlloc`/`CreateFileMapping` on Windows). It makes no attempt at
|
||||||
/// abstracting platform differences, besides in error values returned. Consider
|
/// abstracting platform differences, besides in error values returned. Consider
|
||||||
/// yourself warned.
|
/// yourself warned.
|
||||||
///
|
///
|
||||||
@ -1385,7 +1385,7 @@ pub enum MapError {
|
|||||||
ErrZeroLength,
|
ErrZeroLength,
|
||||||
/// Unrecognized error. The inner value is the unrecognized errno.
|
/// Unrecognized error. The inner value is the unrecognized errno.
|
||||||
ErrUnknown(int),
|
ErrUnknown(int),
|
||||||
/// ## The following are win32-specific
|
/// ## The following are Windows-specific
|
||||||
///
|
///
|
||||||
/// Unsupported combination of protection flags
|
/// Unsupported combination of protection flags
|
||||||
/// (`MapReadable`/`MapWritable`/`MapExecutable`).
|
/// (`MapReadable`/`MapWritable`/`MapExecutable`).
|
||||||
@ -1849,7 +1849,7 @@ pub mod consts {
|
|||||||
pub static FAMILY: &'static str = "windows";
|
pub static FAMILY: &'static str = "windows";
|
||||||
|
|
||||||
/// A string describing the specific operating system in use: in this
|
/// A string describing the specific operating system in use: in this
|
||||||
/// case, `win32`.
|
/// case, `windows`.
|
||||||
pub static SYSNAME: &'static str = "windows";
|
pub static SYSNAME: &'static str = "windows";
|
||||||
|
|
||||||
/// Specifies the filename prefix used for shared libraries on this
|
/// Specifies the filename prefix used for shared libraries on this
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
//! Windows console handling
|
//! Windows console handling
|
||||||
|
|
||||||
// FIXME (#13400): this is only a tiny fraction of the win32 console api
|
// FIXME (#13400): this is only a tiny fraction of the Windows console api
|
||||||
|
|
||||||
extern crate libc;
|
extern crate libc;
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
// aux-build:linkage-visibility.rs
|
// aux-build:linkage-visibility.rs
|
||||||
// ignore-android: FIXME(#10379)
|
// ignore-android: FIXME(#10379)
|
||||||
// ignore-windows: std::dynamic_lib does not work on win32 well
|
// ignore-windows: std::dynamic_lib does not work on Windows well
|
||||||
|
|
||||||
extern crate foo = "linkage-visibility";
|
extern crate foo = "linkage-visibility";
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user