Skip to content

Commit 3dd8768

Browse files
committed
Try to fix win32 breakage on os.
1 parent b41d514 commit 3dd8768

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/libcore/os.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,24 +66,23 @@ pub fn fill_charp_buf(f: fn(*mut c_char, size_t) -> bool)
6666

6767
#[cfg(windows)]
6868
mod win32 {
69-
use dword = libc::DWORD;
69+
use libc::DWORD;
7070

71-
fn fill_utf16_buf_and_decode(f: fn(*mut u16, dword) -> dword)
71+
fn fill_utf16_buf_and_decode(f: fn(*mut u16, DWORD) -> DWORD)
7272
-> Option<~str> {
73-
use libc::dword;
74-
let mut n = tmpbuf_sz as dword;
73+
let mut n = tmpbuf_sz as DWORD;
7574
let mut res = None;
7675
let mut done = false;
7776
while !done {
7877
let buf = vec::to_mut(vec::from_elem(n as uint, 0u16));
7978
do vec::as_mut_buf(buf) |b, _sz| {
80-
let k : dword = f(b, tmpbuf_sz as dword);
81-
if k == (0 as dword) {
79+
let k : DWORD = f(b, tmpbuf_sz as DWORD);
80+
if k == (0 as DWORD) {
8281
done = true;
8382
} else if (k == n &&
8483
libc::GetLastError() ==
85-
libc::ERROR_INSUFFICIENT_BUFFER as dword) {
86-
n *= (2 as dword);
84+
libc::ERROR_INSUFFICIENT_BUFFER as DWORD) {
85+
n *= (2 as DWORD);
8786
} else {
8887
let sub = vec::slice(buf, 0u, k as uint);
8988
res = option::Some(str::from_utf16(sub));
@@ -394,7 +393,7 @@ pub fn self_exe_path() -> Option<Path> {
394393
fn load_self() -> Option<~str> {
395394
use win32::*;
396395
do fill_utf16_buf_and_decode() |buf, sz| {
397-
libc::GetModuleFileNameW(0u as libc::dword, buf, sz)
396+
libc::GetModuleFileNameW(0u as libc::DWORD, buf, sz)
398397
}
399398
}
400399

0 commit comments

Comments
 (0)