fix std build for darwin

master
Andrew Kelley 2017-04-03 19:30:03 -04:00
parent c9ae30d27e
commit 55dd2676ef
2 changed files with 2 additions and 2 deletions

View File

@ -59,7 +59,7 @@ pub fn exit(status: usize) -> noreturn {
/// Get the errno from a syscall return value, or 0 for no error.
pub fn getErrno(r: usize) -> usize {
const signed_r = *(&isize)(&r);
const signed_r = *@ptrcast(&const isize, &r);
if (signed_r > -4096 and signed_r < 0) usize(-signed_r) else 0
}

View File

@ -253,7 +253,7 @@ pub fn WIFSIGNALED(s: i32) -> bool { (unsigned(s)&0xffff)-%1 < 0xff }
/// Get the errno from a syscall return value, or 0 for no error.
pub fn getErrno(r: usize) -> usize {
const signed_r = *@ptrcast(&isize, &r);
const signed_r = *@ptrcast(&const isize, &r);
if (signed_r > -4096 and signed_r < 0) usize(-signed_r) else 0
}