diff options
| author | Andrea Orru <andreaorru1991@gmail.com> | 2018-01-06 23:10:53 -0500 |
|---|---|---|
| committer | Andrea Orru <andreaorru1991@gmail.com> | 2018-01-06 23:10:53 -0500 |
| commit | e932919e680aa6b6ef910e1c4ad969ac1ce0c46d (patch) | |
| tree | 6bd041ade12f4889ecd82584c99dee2f380dbd47 /std/os | |
| parent | dde7cc52d2f4780587b37604889c4568b8d79c62 (diff) | |
| download | zig-e932919e680aa6b6ef910e1c4ad969ac1ce0c46d.tar.gz zig-e932919e680aa6b6ef910e1c4ad969ac1ce0c46d.zip | |
Darwin -> MacOSX, added Zen. See #438
Diffstat (limited to 'std/os')
| -rw-r--r-- | std/os/get_user_id.zig | 2 | ||||
| -rw-r--r-- | std/os/index.zig | 16 | ||||
| -rw-r--r-- | std/os/path.zig | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/std/os/get_user_id.zig b/std/os/get_user_id.zig index 07974fbe09..4b979a9a9d 100644 --- a/std/os/get_user_id.zig +++ b/std/os/get_user_id.zig @@ -11,7 +11,7 @@ pub const UserInfo = struct { /// POSIX function which gets a uid from username. pub fn getUserInfo(name: []const u8) -> %UserInfo { return switch (builtin.os) { - Os.linux, Os.darwin, Os.macosx, Os.ios => posixGetUserInfo(name), + Os.linux, Os.macosx, Os.ios => posixGetUserInfo(name), else => @compileError("Unsupported OS"), }; } diff --git a/std/os/index.zig b/std/os/index.zig index 8ebd586475..c9a7def1bb 100644 --- a/std/os/index.zig +++ b/std/os/index.zig @@ -9,7 +9,7 @@ pub const darwin = @import("darwin.zig"); pub const linux = @import("linux.zig"); pub const posix = switch(builtin.os) { Os.linux => linux, - Os.darwin, Os.macosx, Os.ios => darwin, + Os.macosx, Os.ios => darwin, else => @compileError("Unsupported OS"), }; @@ -89,7 +89,7 @@ pub fn getRandomBytes(buf: []u8) -> %void { } return; }, - Os.darwin, Os.macosx, Os.ios => { + Os.macosx, Os.ios => { const fd = %return posixOpen("/dev/urandom", posix.O_RDONLY|posix.O_CLOEXEC, 0, null); defer close(fd); @@ -130,7 +130,7 @@ pub coldcc fn abort() -> noreturn { c.abort(); } switch (builtin.os) { - Os.linux, Os.darwin, Os.macosx, Os.ios => { + Os.linux, Os.macosx, Os.ios => { _ = posix.raise(posix.SIGABRT); _ = posix.raise(posix.SIGKILL); while (true) {} @@ -151,7 +151,7 @@ pub coldcc fn exit(status: i32) -> noreturn { c.exit(status); } switch (builtin.os) { - Os.linux, Os.darwin, Os.macosx, Os.ios => { + Os.linux, Os.macosx, Os.ios => { posix.exit(status); }, Os.windows => { @@ -1104,7 +1104,7 @@ pub fn readLink(allocator: &Allocator, pathname: []const u8) -> %[]u8 { pub fn sleep(seconds: usize, nanoseconds: usize) { switch(builtin.os) { - Os.linux, Os.darwin, Os.macosx, Os.ios => { + Os.linux, Os.macosx, Os.ios => { posixSleep(u63(seconds), u63(nanoseconds)); }, Os.windows => { @@ -1537,7 +1537,7 @@ pub fn openSelfExe() -> %io.File { Os.linux => { return io.File.openRead("/proc/self/exe", null); }, - Os.darwin => { + Os.macosx, Os.ios => { @panic("TODO: openSelfExe on Darwin"); }, else => @compileError("Unsupported OS"), @@ -1577,7 +1577,7 @@ pub fn selfExePath(allocator: &mem.Allocator) -> %[]u8 { %return out_path.resize(new_len); } }, - Os.darwin, Os.macosx, Os.ios => { + Os.macosx, Os.ios => { var u32_len: u32 = 0; const ret1 = c._NSGetExecutablePath(undefined, &u32_len); assert(ret1 != 0); @@ -1605,7 +1605,7 @@ pub fn selfExeDirPath(allocator: &mem.Allocator) -> %[]u8 { const dir = path.dirname(full_exe_path); return allocator.shrink(u8, full_exe_path, dir.len); }, - Os.windows, Os.darwin, Os.macosx, Os.ios => { + Os.windows, Os.macosx, Os.ios => { const self_exe_path = %return selfExePath(allocator); %defer allocator.free(self_exe_path); const dirname = os.path.dirname(self_exe_path); diff --git a/std/os/path.zig b/std/os/path.zig index fda1f60811..6ea9359361 100644 --- a/std/os/path.zig +++ b/std/os/path.zig @@ -1137,7 +1137,7 @@ pub fn real(allocator: &Allocator, pathname: []const u8) -> %[]u8 { return allocator.shrink(u8, buf, final_len); } }, - Os.darwin, Os.macosx, Os.ios => { + Os.macosx, Os.ios => { // TODO instead of calling the libc function here, port the implementation // to Zig, and then remove the NameTooLong error possibility. const pathname_buf = %return allocator.alloc(u8, pathname.len + 1); |
