Skip to content

Commit bd737d4

Browse files
committed
libcore: Fix Windows resolve errors. rs=bustage
1 parent 1cc22a3 commit bd737d4

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

src/libcore/libc.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -513,9 +513,10 @@ pub mod types {
513513
pub mod bsd44 {
514514
}
515515
pub mod extra {
516-
pub use libc::types::os::arch::c95::{c_void, c_char, c_int,
516+
use libc::types::common::c95::c_void;
517+
use libc::types::os::arch::c95::{c_char, c_int,
517518
c_ulong, wchar_t};
518-
pub use libc::types::os::arch::c99::{c_ulonglong};
519+
use libc::types::os::arch::c99::{c_ulonglong};
519520

520521
pub type BOOL = c_int;
521522
pub type BYTE = u8;
@@ -1135,7 +1136,7 @@ pub mod funcs {
11351136
#[nolink]
11361137
#[abi = "cdecl"]
11371138
pub extern mod stat_ {
1138-
use libc::funcs::posix88::stat_::stat;
1139+
use libc::types::os::common::posix01::stat;
11391140
use libc::types::os::arch::c95::{c_int, c_char};
11401141

11411142
#[link_name = "_chmod"]
@@ -1191,8 +1192,9 @@ pub mod funcs {
11911192
#[nolink]
11921193
#[abi = "cdecl"]
11931194
pub extern mod unistd {
1195+
use libc::types::common::c95::c_void;
11941196
use libc::types::os::arch::c95::{c_int, c_uint, c_char,
1195-
c_long, size_t, c_void};
1197+
c_long, size_t};
11961198

11971199
#[link_name = "_access"]
11981200
fn access(path: *c_char, amode: c_int) -> c_int;

src/libcore/os.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ mod global_env {
254254

255255
#[cfg(windows)]
256256
pub fn getenv(n: &str) -> Option<~str> {
257-
use os::win32::*;
257+
use os::win32::{as_utf16_p, fill_utf16_buf_and_decode};
258258
do as_utf16_p(n) |u| {
259259
do fill_utf16_buf_and_decode() |buf, sz| {
260260
libc::GetEnvironmentVariableW(u, buf, sz)
@@ -275,7 +275,7 @@ mod global_env {
275275

276276
#[cfg(windows)]
277277
pub fn setenv(n: &str, v: &str) {
278-
use os::win32::*;
278+
use os::win32::as_utf16_p;
279279
do as_utf16_p(n) |nbuf| {
280280
do as_utf16_p(v) |vbuf| {
281281
libc::SetEnvironmentVariableW(nbuf, vbuf);
@@ -428,7 +428,7 @@ pub fn self_exe_path() -> Option<Path> {
428428

429429
#[cfg(windows)]
430430
fn load_self() -> Option<~str> {
431-
use os::win32::*;
431+
use os::win32::fill_utf16_buf_and_decode;
432432
do fill_utf16_buf_and_decode() |buf, sz| {
433433
libc::GetModuleFileNameW(0u as libc::DWORD, buf, sz)
434434
}
@@ -591,7 +591,7 @@ pub fn make_dir(p: &Path, mode: c_int) -> bool {
591591

592592
#[cfg(windows)]
593593
fn mkdir(p: &Path, _mode: c_int) -> bool {
594-
use os::win32::*;
594+
use os::win32::as_utf16_p;
595595
// FIXME: turn mode into something useful? #2623
596596
do as_utf16_p(p.to_str()) |buf| {
597597
libc::CreateDirectoryW(buf, unsafe {
@@ -639,7 +639,7 @@ pub fn remove_dir(p: &Path) -> bool {
639639
640640
#[cfg(windows)]
641641
fn rmdir(p: &Path) -> bool {
642-
use os::win32::*;
642+
use os::win32::as_utf16_p;
643643
return do as_utf16_p(p.to_str()) |buf| {
644644
libc::RemoveDirectoryW(buf) != (0 as libc::BOOL)
645645
};
@@ -658,7 +658,7 @@ pub fn change_dir(p: &Path) -> bool {
658658
659659
#[cfg(windows)]
660660
fn chdir(p: &Path) -> bool {
661-
use os::win32::*;
661+
use os::win32::as_utf16_p;
662662
return do as_utf16_p(p.to_str()) |buf| {
663663
libc::SetCurrentDirectoryW(buf) != (0 as libc::BOOL)
664664
};
@@ -678,7 +678,7 @@ pub fn copy_file(from: &Path, to: &Path) -> bool {
678678
679679
#[cfg(windows)]
680680
fn do_copy_file(from: &Path, to: &Path) -> bool {
681-
use os::win32::*;
681+
use os::win32::as_utf16_p;
682682
return do as_utf16_p(from.to_str()) |fromp| {
683683
do as_utf16_p(to.to_str()) |top| {
684684
libc::CopyFileW(fromp, top, (0 as libc::BOOL)) !=
@@ -738,7 +738,7 @@ pub fn remove_file(p: &Path) -> bool {
738738

739739
#[cfg(windows)]
740740
fn unlink(p: &Path) -> bool {
741-
use os::win32::*;
741+
use os::win32::as_utf16_p;
742742
return do as_utf16_p(p.to_str()) |buf| {
743743
libc::DeleteFileW(buf) != (0 as libc::BOOL)
744744
};

0 commit comments

Comments
 (0)