libcore: Fix Windows resolve errors. rs=bustage

This commit is contained in:
Patrick Walton 2013-01-09 20:39:37 -08:00
parent 1cc22a35df
commit bd737d41a1
2 changed files with 14 additions and 12 deletions

View File

@ -513,9 +513,10 @@ pub mod types {
pub mod bsd44 {
}
pub mod extra {
pub use libc::types::os::arch::c95::{c_void, c_char, c_int,
use libc::types::common::c95::c_void;
use libc::types::os::arch::c95::{c_char, c_int,
c_ulong, wchar_t};
pub use libc::types::os::arch::c99::{c_ulonglong};
use libc::types::os::arch::c99::{c_ulonglong};
pub type BOOL = c_int;
pub type BYTE = u8;
@ -1135,7 +1136,7 @@ pub mod funcs {
#[nolink]
#[abi = "cdecl"]
pub extern mod stat_ {
use libc::funcs::posix88::stat_::stat;
use libc::types::os::common::posix01::stat;
use libc::types::os::arch::c95::{c_int, c_char};
#[link_name = "_chmod"]
@ -1191,8 +1192,9 @@ pub mod funcs {
#[nolink]
#[abi = "cdecl"]
pub extern mod unistd {
use libc::types::common::c95::c_void;
use libc::types::os::arch::c95::{c_int, c_uint, c_char,
c_long, size_t, c_void};
c_long, size_t};
#[link_name = "_access"]
fn access(path: *c_char, amode: c_int) -> c_int;

View File

@ -254,7 +254,7 @@ mod global_env {
#[cfg(windows)]
pub fn getenv(n: &str) -> Option<~str> {
use os::win32::*;
use os::win32::{as_utf16_p, fill_utf16_buf_and_decode};
do as_utf16_p(n) |u| {
do fill_utf16_buf_and_decode() |buf, sz| {
libc::GetEnvironmentVariableW(u, buf, sz)
@ -275,7 +275,7 @@ mod global_env {
#[cfg(windows)]
pub fn setenv(n: &str, v: &str) {
use os::win32::*;
use os::win32::as_utf16_p;
do as_utf16_p(n) |nbuf| {
do as_utf16_p(v) |vbuf| {
libc::SetEnvironmentVariableW(nbuf, vbuf);
@ -428,7 +428,7 @@ pub fn self_exe_path() -> Option<Path> {
#[cfg(windows)]
fn load_self() -> Option<~str> {
use os::win32::*;
use os::win32::fill_utf16_buf_and_decode;
do fill_utf16_buf_and_decode() |buf, sz| {
libc::GetModuleFileNameW(0u as libc::DWORD, buf, sz)
}
@ -591,7 +591,7 @@ pub fn make_dir(p: &Path, mode: c_int) -> bool {
#[cfg(windows)]
fn mkdir(p: &Path, _mode: c_int) -> bool {
use os::win32::*;
use os::win32::as_utf16_p;
// FIXME: turn mode into something useful? #2623
do as_utf16_p(p.to_str()) |buf| {
libc::CreateDirectoryW(buf, unsafe {
@ -639,7 +639,7 @@ pub fn remove_dir(p: &Path) -> bool {
#[cfg(windows)]
fn rmdir(p: &Path) -> bool {
use os::win32::*;
use os::win32::as_utf16_p;
return do as_utf16_p(p.to_str()) |buf| {
libc::RemoveDirectoryW(buf) != (0 as libc::BOOL)
};
@ -658,7 +658,7 @@ pub fn change_dir(p: &Path) -> bool {
#[cfg(windows)]
fn chdir(p: &Path) -> bool {
use os::win32::*;
use os::win32::as_utf16_p;
return do as_utf16_p(p.to_str()) |buf| {
libc::SetCurrentDirectoryW(buf) != (0 as libc::BOOL)
};
@ -678,7 +678,7 @@ pub fn copy_file(from: &Path, to: &Path) -> bool {
#[cfg(windows)]
fn do_copy_file(from: &Path, to: &Path) -> bool {
use os::win32::*;
use os::win32::as_utf16_p;
return do as_utf16_p(from.to_str()) |fromp| {
do as_utf16_p(to.to_str()) |top| {
libc::CopyFileW(fromp, top, (0 as libc::BOOL)) !=
@ -738,7 +738,7 @@ pub fn remove_file(p: &Path) -> bool {
#[cfg(windows)]
fn unlink(p: &Path) -> bool {
use os::win32::*;
use os::win32::as_utf16_p;
return do as_utf16_p(p.to_str()) |buf| {
libc::DeleteFileW(buf) != (0 as libc::BOOL)
};