commit 55dd2676eff89176d0b87e45893becc2cc762136 (tree)
parent c9ae30d27e123f87fc9c10b6af2e380eab57d6df
Author: Andrew Kelley <superjoe30@gmail.com>
Date: Mon, 3 Apr 2017 19:30:03 -0400
fix std build for darwin
Diffstat:
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/std/os/darwin.zig b/std/os/darwin.zig
@@ -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
}
diff --git a/std/os/linux.zig b/std/os/linux.zig
@@ -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
}