| author | |
| committer | |
| log | 2ab0c7391a871a3063f825e08e02ea2a8e9269e9 |
| tree | 1df222038a4065fe79841250af05cd03e0ead725 |
| parent | 53c63bdb73d9fbc5a54afb4977bb975b03c4c9cc |
26 files changed, 73 insertions(+), 71 deletions(-)
lib/std/c.zig+4-4| ... | ... | @@ -22,7 +22,7 @@ pub usingnamespace @import("os/bits.zig"); |
| 22 | 22 | pub usingnamespace switch (std.Target.current.os.tag) { |
| 23 | 23 | .linux => @import("c/linux.zig"), |
| 24 | 24 | .windows => @import("c/windows.zig"), |
| 25 | .macosx, .ios, .tvos, .watchos => @import("c/darwin.zig"), | |
| 25 | .macos, .ios, .tvos, .watchos => @import("c/darwin.zig"), | |
| 26 | 26 | .freebsd, .kfreebsd => @import("c/freebsd.zig"), |
| 27 | 27 | .netbsd => @import("c/netbsd.zig"), |
| 28 | 28 | .dragonfly => @import("c/dragonfly.zig"), |
| ... | ... | @@ -122,7 +122,7 @@ pub extern "c" fn readlink(noalias path: [*:0]const u8, noalias buf: [*]u8, bufs |
| 122 | 122 | pub extern "c" fn readlinkat(dirfd: fd_t, noalias path: [*:0]const u8, noalias buf: [*]u8, bufsize: usize) isize; |
| 123 | 123 | |
| 124 | 124 | pub usingnamespace switch (builtin.os.tag) { |
| 125 | .macosx, .ios, .watchos, .tvos => struct { | |
| 125 | .macos, .ios, .watchos, .tvos => struct { | |
| 126 | 126 | pub const realpath = @"realpath$DARWIN_EXTSN"; |
| 127 | 127 | pub const fstatat = @"fstatat$INODE64"; |
| 128 | 128 | }, |
| ... | ... | @@ -189,7 +189,7 @@ pub usingnamespace switch (builtin.os.tag) { |
| 189 | 189 | pub const sigprocmask = __sigprocmask14; |
| 190 | 190 | pub const stat = __stat50; |
| 191 | 191 | }, |
| 192 | .macosx, .ios, .watchos, .tvos => struct { | |
| 192 | .macos, .ios, .watchos, .tvos => struct { | |
| 193 | 193 | // XXX: close -> close$NOCANCEL |
| 194 | 194 | // XXX: getdirentries -> _getdirentries64 |
| 195 | 195 | pub extern "c" fn clock_getres(clk_id: c_int, tp: *timespec) c_int; |
| ... | ... | @@ -252,7 +252,7 @@ pub usingnamespace switch (builtin.os.tag) { |
| 252 | 252 | .linux, .freebsd, .kfreebsd, .netbsd, .openbsd => struct { |
| 253 | 253 | pub extern "c" fn malloc_usable_size(?*const c_void) usize; |
| 254 | 254 | }, |
| 255 | .macosx, .ios, .watchos, .tvos => struct { | |
| 255 | .macos, .ios, .watchos, .tvos => struct { | |
| 256 | 256 | pub extern "c" fn malloc_size(?*const c_void) usize; |
| 257 | 257 | }, |
| 258 | 258 | else => struct {}, |
lib/std/debug.zig+2-2| ... | ... | @@ -654,7 +654,7 @@ pub fn openSelfDebugInfo(allocator: *mem.Allocator) anyerror!DebugInfo { |
| 654 | 654 | .freebsd, |
| 655 | 655 | .netbsd, |
| 656 | 656 | .dragonfly, |
| 657 | .macosx, | |
| 657 | .macos, | |
| 658 | 658 | .windows, |
| 659 | 659 | => return DebugInfo.init(allocator), |
| 660 | 660 | else => @compileError("openSelfDebugInfo unsupported for this platform"), |
| ... | ... | @@ -1320,7 +1320,7 @@ const SymbolInfo = struct { |
| 1320 | 1320 | }; |
| 1321 | 1321 | |
| 1322 | 1322 | pub const ModuleDebugInfo = switch (builtin.os.tag) { |
| 1323 | .macosx, .ios, .watchos, .tvos => struct { | |
| 1323 | .macos, .ios, .watchos, .tvos => struct { | |
| 1324 | 1324 | base_address: usize, |
| 1325 | 1325 | mapped_memory: []const u8, |
| 1326 | 1326 | symbols: []const MachoSymbol, |
lib/std/dynamic_library.zig+2-2| ... | ... | @@ -19,7 +19,7 @@ const max = std.math.max; |
| 19 | 19 | pub const DynLib = switch (builtin.os.tag) { |
| 20 | 20 | .linux => if (builtin.link_libc) DlDynlib else ElfDynLib, |
| 21 | 21 | .windows => WindowsDynLib, |
| 22 | .macosx, .tvos, .watchos, .ios, .freebsd => DlDynlib, | |
| 22 | .macos, .tvos, .watchos, .ios, .freebsd => DlDynlib, | |
| 23 | 23 | else => void, |
| 24 | 24 | }; |
| 25 | 25 | |
| ... | ... | @@ -404,7 +404,7 @@ test "dynamic_library" { |
| 404 | 404 | const libname = switch (builtin.os.tag) { |
| 405 | 405 | .linux, .freebsd => "invalid_so.so", |
| 406 | 406 | .windows => "invalid_dll.dll", |
| 407 | .macosx, .tvos, .watchos, .ios => "invalid_dylib.dylib", | |
| 407 | .macos, .tvos, .watchos, .ios => "invalid_dylib.dylib", | |
| 408 | 408 | else => return error.SkipZigTest, |
| 409 | 409 | }; |
| 410 | 410 |
lib/std/event/loop.zig+12-12| ... | ... | @@ -66,7 +66,7 @@ pub const Loop = struct { |
| 66 | 66 | }; |
| 67 | 67 | |
| 68 | 68 | pub const EventFd = switch (builtin.os.tag) { |
| 69 | .macosx, .freebsd, .netbsd, .dragonfly => KEventFd, | |
| 69 | .macos, .freebsd, .netbsd, .dragonfly => KEventFd, | |
| 70 | 70 | .linux => struct { |
| 71 | 71 | base: ResumeNode, |
| 72 | 72 | epoll_op: u32, |
| ... | ... | @@ -85,7 +85,7 @@ pub const Loop = struct { |
| 85 | 85 | }; |
| 86 | 86 | |
| 87 | 87 | pub const Basic = switch (builtin.os.tag) { |
| 88 | .macosx, .freebsd, .netbsd, .dragonfly => KEventBasic, | |
| 88 | .macos, .freebsd, .netbsd, .dragonfly => KEventBasic, | |
| 89 | 89 | .linux => struct { |
| 90 | 90 | base: ResumeNode, |
| 91 | 91 | }, |
| ... | ... | @@ -259,7 +259,7 @@ pub const Loop = struct { |
| 259 | 259 | self.extra_threads[extra_thread_index] = try Thread.spawn(self, workerRun); |
| 260 | 260 | } |
| 261 | 261 | }, |
| 262 | .macosx, .freebsd, .netbsd, .dragonfly => { | |
| 262 | .macos, .freebsd, .netbsd, .dragonfly => { | |
| 263 | 263 | self.os_data.kqfd = try os.kqueue(); |
| 264 | 264 | errdefer os.close(self.os_data.kqfd); |
| 265 | 265 | |
| ... | ... | @@ -384,7 +384,7 @@ pub const Loop = struct { |
| 384 | 384 | while (self.available_eventfd_resume_nodes.pop()) |node| os.close(node.data.eventfd); |
| 385 | 385 | os.close(self.os_data.epollfd); |
| 386 | 386 | }, |
| 387 | .macosx, .freebsd, .netbsd, .dragonfly => { | |
| 387 | .macos, .freebsd, .netbsd, .dragonfly => { | |
| 388 | 388 | os.close(self.os_data.kqfd); |
| 389 | 389 | }, |
| 390 | 390 | .windows => { |
| ... | ... | @@ -478,7 +478,7 @@ pub const Loop = struct { |
| 478 | 478 | .linux => { |
| 479 | 479 | self.linuxWaitFd(fd, os.EPOLLET | os.EPOLLONESHOT | os.EPOLLIN); |
| 480 | 480 | }, |
| 481 | .macosx, .freebsd, .netbsd, .dragonfly => { | |
| 481 | .macos, .freebsd, .netbsd, .dragonfly => { | |
| 482 | 482 | self.bsdWaitKev(@intCast(usize, fd), os.EVFILT_READ, os.EV_ONESHOT); |
| 483 | 483 | }, |
| 484 | 484 | else => @compileError("Unsupported OS"), |
| ... | ... | @@ -490,7 +490,7 @@ pub const Loop = struct { |
| 490 | 490 | .linux => { |
| 491 | 491 | self.linuxWaitFd(fd, os.EPOLLET | os.EPOLLONESHOT | os.EPOLLOUT); |
| 492 | 492 | }, |
| 493 | .macosx, .freebsd, .netbsd, .dragonfly => { | |
| 493 | .macos, .freebsd, .netbsd, .dragonfly => { | |
| 494 | 494 | self.bsdWaitKev(@intCast(usize, fd), os.EVFILT_WRITE, os.EV_ONESHOT); |
| 495 | 495 | }, |
| 496 | 496 | else => @compileError("Unsupported OS"), |
| ... | ... | @@ -502,7 +502,7 @@ pub const Loop = struct { |
| 502 | 502 | .linux => { |
| 503 | 503 | self.linuxWaitFd(fd, os.EPOLLET | os.EPOLLONESHOT | os.EPOLLOUT | os.EPOLLIN); |
| 504 | 504 | }, |
| 505 | .macosx, .freebsd, .netbsd, .dragonfly => { | |
| 505 | .macos, .freebsd, .netbsd, .dragonfly => { | |
| 506 | 506 | self.bsdWaitKev(@intCast(usize, fd), os.EVFILT_READ, os.EV_ONESHOT); |
| 507 | 507 | self.bsdWaitKev(@intCast(usize, fd), os.EVFILT_WRITE, os.EV_ONESHOT); |
| 508 | 508 | }, |
| ... | ... | @@ -571,7 +571,7 @@ pub const Loop = struct { |
| 571 | 571 | const eventfd_node = &resume_stack_node.data; |
| 572 | 572 | eventfd_node.base.handle = next_tick_node.data; |
| 573 | 573 | switch (builtin.os.tag) { |
| 574 | .macosx, .freebsd, .netbsd, .dragonfly => { | |
| 574 | .macos, .freebsd, .netbsd, .dragonfly => { | |
| 575 | 575 | const kevent_array = @as(*const [1]os.Kevent, &eventfd_node.kevent); |
| 576 | 576 | const empty_kevs = &[0]os.Kevent{}; |
| 577 | 577 | _ = os.kevent(self.os_data.kqfd, kevent_array, empty_kevs, null) catch { |
| ... | ... | @@ -633,7 +633,7 @@ pub const Loop = struct { |
| 633 | 633 | if (!builtin.single_threaded) { |
| 634 | 634 | switch (builtin.os.tag) { |
| 635 | 635 | .linux, |
| 636 | .macosx, | |
| 636 | .macos, | |
| 637 | 637 | .freebsd, |
| 638 | 638 | .netbsd, |
| 639 | 639 | .dragonfly, |
| ... | ... | @@ -725,7 +725,7 @@ pub const Loop = struct { |
| 725 | 725 | } |
| 726 | 726 | return; |
| 727 | 727 | }, |
| 728 | .macosx, .freebsd, .netbsd, .dragonfly => { | |
| 728 | .macos, .freebsd, .netbsd, .dragonfly => { | |
| 729 | 729 | const final_kevent = @as(*const [1]os.Kevent, &self.os_data.final_kevent); |
| 730 | 730 | const empty_kevs = &[0]os.Kevent{}; |
| 731 | 731 | // cannot fail because we already added it and this just enables it |
| ... | ... | @@ -1218,7 +1218,7 @@ pub const Loop = struct { |
| 1218 | 1218 | } |
| 1219 | 1219 | } |
| 1220 | 1220 | }, |
| 1221 | .macosx, .freebsd, .netbsd, .dragonfly => { | |
| 1221 | .macos, .freebsd, .netbsd, .dragonfly => { | |
| 1222 | 1222 | var eventlist: [1]os.Kevent = undefined; |
| 1223 | 1223 | const empty_kevs = &[0]os.Kevent{}; |
| 1224 | 1224 | const count = os.kevent(self.os_data.kqfd, empty_kevs, eventlist[0..], null) catch unreachable; |
| ... | ... | @@ -1344,7 +1344,7 @@ pub const Loop = struct { |
| 1344 | 1344 | |
| 1345 | 1345 | const OsData = switch (builtin.os.tag) { |
| 1346 | 1346 | .linux => LinuxOsData, |
| 1347 | .macosx, .freebsd, .netbsd, .dragonfly => KEventData, | |
| 1347 | .macos, .freebsd, .netbsd, .dragonfly => KEventData, | |
| 1348 | 1348 | .windows => struct { |
| 1349 | 1349 | io_port: windows.HANDLE, |
| 1350 | 1350 | extra_thread_count: usize, |
lib/std/fs.zig+5-5| ... | ... | @@ -39,7 +39,7 @@ pub const Watch = @import("fs/watch.zig").Watch; |
| 39 | 39 | /// fit into a UTF-8 encoded array of this length. |
| 40 | 40 | /// The byte count includes room for a null sentinel byte. |
| 41 | 41 | pub const MAX_PATH_BYTES = switch (builtin.os.tag) { |
| 42 | .linux, .macosx, .ios, .freebsd, .netbsd, .dragonfly => os.PATH_MAX, | |
| 42 | .linux, .macos, .ios, .freebsd, .netbsd, .dragonfly => os.PATH_MAX, | |
| 43 | 43 | // Each UTF-16LE character may be expanded to 3 UTF-8 bytes. |
| 44 | 44 | // If it would require 4 UTF-8 bytes, then there would be a surrogate |
| 45 | 45 | // pair in the UTF-16LE, and we (over)account 3 bytes for it that way. |
| ... | ... | @@ -303,7 +303,7 @@ pub const Dir = struct { |
| 303 | 303 | const IteratorError = error{AccessDenied} || os.UnexpectedError; |
| 304 | 304 | |
| 305 | 305 | pub const Iterator = switch (builtin.os.tag) { |
| 306 | .macosx, .ios, .freebsd, .netbsd, .dragonfly => struct { | |
| 306 | .macos, .ios, .freebsd, .netbsd, .dragonfly => struct { | |
| 307 | 307 | dir: Dir, |
| 308 | 308 | seek: i64, |
| 309 | 309 | buf: [8192]u8, // TODO align(@alignOf(os.dirent)), |
| ... | ... | @@ -318,7 +318,7 @@ pub const Dir = struct { |
| 318 | 318 | /// with subsequent calls to `next`, as well as when this `Dir` is deinitialized. |
| 319 | 319 | pub fn next(self: *Self) Error!?Entry { |
| 320 | 320 | switch (builtin.os.tag) { |
| 321 | .macosx, .ios => return self.nextDarwin(), | |
| 321 | .macos, .ios => return self.nextDarwin(), | |
| 322 | 322 | .freebsd, .netbsd, .dragonfly => return self.nextBsd(), |
| 323 | 323 | else => @compileError("unimplemented"), |
| 324 | 324 | } |
| ... | ... | @@ -615,7 +615,7 @@ pub const Dir = struct { |
| 615 | 615 | |
| 616 | 616 | pub fn iterate(self: Dir) Iterator { |
| 617 | 617 | switch (builtin.os.tag) { |
| 618 | .macosx, .ios, .freebsd, .netbsd, .dragonfly => return Iterator{ | |
| 618 | .macos, .ios, .freebsd, .netbsd, .dragonfly => return Iterator{ | |
| 619 | 619 | .dir = self, |
| 620 | 620 | .seek = 0, |
| 621 | 621 | .index = 0, |
| ... | ... | @@ -1302,7 +1302,7 @@ pub const Dir = struct { |
| 1302 | 1302 | error.AccessDenied => |e| switch (builtin.os.tag) { |
| 1303 | 1303 | // non-Linux POSIX systems return EPERM when trying to delete a directory, so |
| 1304 | 1304 | // we need to handle that case specifically and translate the error |
| 1305 | .macosx, .ios, .freebsd, .netbsd, .dragonfly => { | |
| 1305 | .macos, .ios, .freebsd, .netbsd, .dragonfly => { | |
| 1306 | 1306 | // Don't follow symlinks to match unlinkat (which acts on symlinks rather than follows them) |
| 1307 | 1307 | const fstat = os.fstatatZ(self.fd, sub_path_c, os.AT_SYMLINK_NOFOLLOW) catch return e; |
| 1308 | 1308 | const is_dir = fstat.mode & os.S_IFMT == os.S_IFDIR; |
lib/std/fs/get_app_data_dir.zig+1-1| ... | ... | @@ -42,7 +42,7 @@ pub fn getAppDataDir(allocator: *mem.Allocator, appname: []const u8) GetAppDataD |
| 42 | 42 | else => return error.AppDataDirUnavailable, |
| 43 | 43 | } |
| 44 | 44 | }, |
| 45 | .macosx => { | |
| 45 | .macos => { | |
| 46 | 46 | const home_dir = os.getenv("HOME") orelse { |
| 47 | 47 | // TODO look in /etc/passwd |
| 48 | 48 | return error.AppDataDirUnavailable; |
lib/std/fs/test.zig+1-1| ... | ... | @@ -143,7 +143,7 @@ fn contains(entries: *const std.ArrayList(Dir.Entry), el: Dir.Entry) bool { |
| 143 | 143 | |
| 144 | 144 | test "Dir.realpath smoke test" { |
| 145 | 145 | switch (builtin.os.tag) { |
| 146 | .linux, .windows, .macosx, .ios, .watchos, .tvos => {}, | |
| 146 | .linux, .windows, .macos, .ios, .watchos, .tvos => {}, | |
| 147 | 147 | else => return error.SkipZigTest, |
| 148 | 148 | } |
| 149 | 149 |
lib/std/fs/watch.zig+4-4| ... | ... | @@ -49,7 +49,7 @@ pub fn Watch(comptime V: type) type { |
| 49 | 49 | |
| 50 | 50 | const OsData = switch (builtin.os.tag) { |
| 51 | 51 | // TODO https://github.com/ziglang/zig/issues/3778 |
| 52 | .macosx, .freebsd, .netbsd, .dragonfly => KqOsData, | |
| 52 | .macos, .freebsd, .netbsd, .dragonfly => KqOsData, | |
| 53 | 53 | .linux => LinuxOsData, |
| 54 | 54 | .windows => WindowsOsData, |
| 55 | 55 | |
| ... | ... | @@ -160,7 +160,7 @@ pub fn Watch(comptime V: type) type { |
| 160 | 160 | return self; |
| 161 | 161 | }, |
| 162 | 162 | |
| 163 | .macosx, .freebsd, .netbsd, .dragonfly => { | |
| 163 | .macos, .freebsd, .netbsd, .dragonfly => { | |
| 164 | 164 | self.* = Self{ |
| 165 | 165 | .allocator = allocator, |
| 166 | 166 | .channel = channel, |
| ... | ... | @@ -178,7 +178,7 @@ pub fn Watch(comptime V: type) type { |
| 178 | 178 | /// All addFile calls and removeFile calls must have completed. |
| 179 | 179 | pub fn deinit(self: *Self) void { |
| 180 | 180 | switch (builtin.os.tag) { |
| 181 | .macosx, .freebsd, .netbsd, .dragonfly => { | |
| 181 | .macos, .freebsd, .netbsd, .dragonfly => { | |
| 182 | 182 | // TODO we need to cancel the frames before destroying the lock |
| 183 | 183 | self.os_data.table_lock.deinit(); |
| 184 | 184 | var it = self.os_data.file_table.iterator(); |
| ... | ... | @@ -229,7 +229,7 @@ pub fn Watch(comptime V: type) type { |
| 229 | 229 | |
| 230 | 230 | pub fn addFile(self: *Self, file_path: []const u8, value: V) !?V { |
| 231 | 231 | switch (builtin.os.tag) { |
| 232 | .macosx, .freebsd, .netbsd, .dragonfly => return addFileKEvent(self, file_path, value), | |
| 232 | .macos, .freebsd, .netbsd, .dragonfly => return addFileKEvent(self, file_path, value), | |
| 233 | 233 | .linux => return addFileLinux(self, file_path, value), |
| 234 | 234 | .windows => return addFileWindows(self, file_path, value), |
| 235 | 235 | else => @compileError("Unsupported OS"), |
lib/std/os.zig+9-9| ... | ... | @@ -62,7 +62,7 @@ pub const system = if (@hasDecl(root, "os") and root.os != @This()) |
| 62 | 62 | else if (builtin.link_libc) |
| 63 | 63 | std.c |
| 64 | 64 | else switch (builtin.os.tag) { |
| 65 | .macosx, .ios, .watchos, .tvos => darwin, | |
| 65 | .macos, .ios, .watchos, .tvos => darwin, | |
| 66 | 66 | .freebsd => freebsd, |
| 67 | 67 | .linux => linux, |
| 68 | 68 | .netbsd => netbsd, |
| ... | ... | @@ -354,7 +354,7 @@ pub fn read(fd: fd_t, buf: []u8) ReadError!usize { |
| 354 | 354 | // Prevents EINVAL. |
| 355 | 355 | const max_count = switch (std.Target.current.os.tag) { |
| 356 | 356 | .linux => 0x7ffff000, |
| 357 | .macosx, .ios, .watchos, .tvos => math.maxInt(i32), | |
| 357 | .macos, .ios, .watchos, .tvos => math.maxInt(i32), | |
| 358 | 358 | else => math.maxInt(isize), |
| 359 | 359 | }; |
| 360 | 360 | const adjusted_len = math.min(max_count, buf.len); |
| ... | ... | @@ -582,7 +582,7 @@ pub fn ftruncate(fd: fd_t, length: u64) TruncateError!void { |
| 582 | 582 | /// On these systems, the read races with concurrent writes to the same file descriptor. |
| 583 | 583 | pub fn preadv(fd: fd_t, iov: []const iovec, offset: u64) PReadError!usize { |
| 584 | 584 | const have_pread_but_not_preadv = switch (std.Target.current.os.tag) { |
| 585 | .windows, .macosx, .ios, .watchos, .tvos => true, | |
| 585 | .windows, .macos, .ios, .watchos, .tvos => true, | |
| 586 | 586 | else => false, |
| 587 | 587 | }; |
| 588 | 588 | if (have_pread_but_not_preadv) { |
| ... | ... | @@ -709,7 +709,7 @@ pub fn write(fd: fd_t, bytes: []const u8) WriteError!usize { |
| 709 | 709 | |
| 710 | 710 | const max_count = switch (std.Target.current.os.tag) { |
| 711 | 711 | .linux => 0x7ffff000, |
| 712 | .macosx, .ios, .watchos, .tvos => math.maxInt(i32), | |
| 712 | .macos, .ios, .watchos, .tvos => math.maxInt(i32), | |
| 713 | 713 | else => math.maxInt(isize), |
| 714 | 714 | }; |
| 715 | 715 | const adjusted_len = math.min(max_count, bytes.len); |
| ... | ... | @@ -863,7 +863,7 @@ pub fn pwrite(fd: fd_t, bytes: []const u8, offset: u64) PWriteError!usize { |
| 863 | 863 | // Prevent EINVAL. |
| 864 | 864 | const max_count = switch (std.Target.current.os.tag) { |
| 865 | 865 | .linux => 0x7ffff000, |
| 866 | .macosx, .ios, .watchos, .tvos => math.maxInt(i32), | |
| 866 | .macos, .ios, .watchos, .tvos => math.maxInt(i32), | |
| 867 | 867 | else => math.maxInt(isize), |
| 868 | 868 | }; |
| 869 | 869 | const adjusted_len = math.min(max_count, bytes.len); |
| ... | ... | @@ -915,7 +915,7 @@ pub fn pwrite(fd: fd_t, bytes: []const u8, offset: u64) PWriteError!usize { |
| 915 | 915 | /// If `iov.len` is larger than will fit in a `u31`, a partial write will occur. |
| 916 | 916 | pub fn pwritev(fd: fd_t, iov: []const iovec_const, offset: u64) PWriteError!usize { |
| 917 | 917 | const have_pwrite_but_not_pwritev = switch (std.Target.current.os.tag) { |
| 918 | .windows, .macosx, .ios, .watchos, .tvos => true, | |
| 918 | .windows, .macos, .ios, .watchos, .tvos => true, | |
| 919 | 919 | else => false, |
| 920 | 920 | }; |
| 921 | 921 | |
| ... | ... | @@ -4091,7 +4091,7 @@ pub fn getFdPath(fd: fd_t, out_buffer: *[MAX_PATH_BYTES]u8) RealPathError![]u8 { |
| 4091 | 4091 | const end_index = std.unicode.utf16leToUtf8(out_buffer, wide_slice) catch unreachable; |
| 4092 | 4092 | return out_buffer[0..end_index]; |
| 4093 | 4093 | }, |
| 4094 | .macosx, .ios, .watchos, .tvos => { | |
| 4094 | .macos, .ios, .watchos, .tvos => { | |
| 4095 | 4095 | // On macOS, we can use F_GETPATH fcntl command to query the OS for |
| 4096 | 4096 | // the path to the file descriptor. |
| 4097 | 4097 | @memset(out_buffer, 0, MAX_PATH_BYTES); |
| ... | ... | @@ -4688,7 +4688,7 @@ pub fn sendfile( |
| 4688 | 4688 | }); |
| 4689 | 4689 | const max_count = switch (std.Target.current.os.tag) { |
| 4690 | 4690 | .linux => 0x7ffff000, |
| 4691 | .macosx, .ios, .watchos, .tvos => math.maxInt(i32), | |
| 4691 | .macos, .ios, .watchos, .tvos => math.maxInt(i32), | |
| 4692 | 4692 | else => math.maxInt(size_t), |
| 4693 | 4693 | }; |
| 4694 | 4694 | |
| ... | ... | @@ -4846,7 +4846,7 @@ pub fn sendfile( |
| 4846 | 4846 | } |
| 4847 | 4847 | } |
| 4848 | 4848 | }, |
| 4849 | .macosx, .ios, .tvos, .watchos => sf: { | |
| 4849 | .macos, .ios, .tvos, .watchos => sf: { | |
| 4850 | 4850 | var hdtr_data: std.c.sf_hdtr = undefined; |
| 4851 | 4851 | var hdtr: ?*std.c.sf_hdtr = null; |
| 4852 | 4852 | if (headers.len != 0 or trailers.len != 0) { |
lib/std/os/bits.zig+1-1| ... | ... | @@ -12,7 +12,7 @@ const std = @import("std"); |
| 12 | 12 | const root = @import("root"); |
| 13 | 13 | |
| 14 | 14 | pub usingnamespace switch (std.Target.current.os.tag) { |
| 15 | .macosx, .ios, .tvos, .watchos => @import("bits/darwin.zig"), | |
| 15 | .macos, .ios, .tvos, .watchos => @import("bits/darwin.zig"), | |
| 16 | 16 | .dragonfly => @import("bits/dragonfly.zig"), |
| 17 | 17 | .freebsd => @import("bits/freebsd.zig"), |
| 18 | 18 | .linux => @import("bits/linux.zig"), |
lib/std/os/test.zig+1-1| ... | ... | @@ -360,7 +360,7 @@ fn iter_fn(info: *dl_phdr_info, size: usize, counter: *usize) IterFnError!void { |
| 360 | 360 | } |
| 361 | 361 | |
| 362 | 362 | test "dl_iterate_phdr" { |
| 363 | if (builtin.os.tag == .windows or builtin.os.tag == .wasi or builtin.os.tag == .macosx) | |
| 363 | if (builtin.os.tag == .windows or builtin.os.tag == .wasi or builtin.os.tag == .macos) | |
| 364 | 364 | return error.SkipZigTest; |
| 365 | 365 | |
| 366 | 366 | var counter: usize = 0; |
lib/std/packed_int_array.zig+2-2| ... | ... | @@ -618,7 +618,7 @@ test "PackedIntArray at end of available memory" { |
| 618 | 618 | if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest; |
| 619 | 619 | |
| 620 | 620 | switch (builtin.os.tag) { |
| 621 | .linux, .macosx, .ios, .freebsd, .netbsd, .windows => {}, | |
| 621 | .linux, .macos, .ios, .freebsd, .netbsd, .windows => {}, | |
| 622 | 622 | else => return, |
| 623 | 623 | } |
| 624 | 624 | const PackedArray = PackedIntArray(u3, 8); |
| ... | ... | @@ -639,7 +639,7 @@ test "PackedIntSlice at end of available memory" { |
| 639 | 639 | if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest; |
| 640 | 640 | |
| 641 | 641 | switch (builtin.os.tag) { |
| 642 | .linux, .macosx, .ios, .freebsd, .netbsd, .windows => {}, | |
| 642 | .linux, .macos, .ios, .freebsd, .netbsd, .windows => {}, | |
| 643 | 643 | else => return, |
| 644 | 644 | } |
| 645 | 645 | const PackedSlice = PackedIntSlice(u11); |
lib/std/process.zig+3-3| ... | ... | @@ -585,7 +585,7 @@ pub const UserInfo = struct { |
| 585 | 585 | /// POSIX function which gets a uid from username. |
| 586 | 586 | pub fn getUserInfo(name: []const u8) !UserInfo { |
| 587 | 587 | return switch (builtin.os.tag) { |
| 588 | .linux, .macosx, .watchos, .tvos, .ios, .freebsd, .netbsd => posixGetUserInfo(name), | |
| 588 | .linux, .macos, .watchos, .tvos, .ios, .freebsd, .netbsd => posixGetUserInfo(name), | |
| 589 | 589 | else => @compileError("Unsupported OS"), |
| 590 | 590 | }; |
| 591 | 591 | } |
| ... | ... | @@ -688,7 +688,7 @@ pub fn getBaseAddress() usize { |
| 688 | 688 | const phdr = os.system.getauxval(std.elf.AT_PHDR); |
| 689 | 689 | return phdr - @sizeOf(std.elf.Ehdr); |
| 690 | 690 | }, |
| 691 | .macosx, .freebsd, .netbsd => { | |
| 691 | .macos, .freebsd, .netbsd => { | |
| 692 | 692 | return @ptrToInt(&std.c._mh_execute_header); |
| 693 | 693 | }, |
| 694 | 694 | .windows => return @ptrToInt(os.windows.kernel32.GetModuleHandleW(null)), |
| ... | ... | @@ -733,7 +733,7 @@ pub fn getSelfExeSharedLibPaths(allocator: *Allocator) error{OutOfMemory}![][:0] |
| 733 | 733 | }.callback); |
| 734 | 734 | return paths.toOwnedSlice(); |
| 735 | 735 | }, |
| 736 | .macosx, .ios, .watchos, .tvos => { | |
| 736 | .macos, .ios, .watchos, .tvos => { | |
| 737 | 737 | var paths = List.init(allocator); |
| 738 | 738 | errdefer { |
| 739 | 739 | const slice = paths.toOwnedSlice(); |
lib/std/special/compiler_rt/clear_cache.zig+1-1| ... | ... | @@ -44,7 +44,7 @@ pub fn clear_cache(start: usize, end: usize) callconv(.C) void { |
| 44 | 44 | else => false, |
| 45 | 45 | }; |
| 46 | 46 | const apple = switch (os) { |
| 47 | .ios, .macosx, .watchos, .tvos => true, | |
| 47 | .ios, .macos, .watchos, .tvos => true, | |
| 48 | 48 | else => false, |
| 49 | 49 | }; |
| 50 | 50 | if (x86) { |
lib/std/target.zig+8-8| ... | ... | @@ -31,7 +31,7 @@ pub const Target = struct { |
| 31 | 31 | kfreebsd, |
| 32 | 32 | linux, |
| 33 | 33 | lv2, |
| 34 | macosx, | |
| 34 | macos, | |
| 35 | 35 | netbsd, |
| 36 | 36 | openbsd, |
| 37 | 37 | solaris, |
| ... | ... | @@ -61,7 +61,7 @@ pub const Target = struct { |
| 61 | 61 | |
| 62 | 62 | pub fn isDarwin(tag: Tag) bool { |
| 63 | 63 | return switch (tag) { |
| 64 | .ios, .macosx, .watchos, .tvos => true, | |
| 64 | .ios, .macos, .watchos, .tvos => true, | |
| 65 | 65 | else => false, |
| 66 | 66 | }; |
| 67 | 67 | } |
| ... | ... | @@ -234,7 +234,7 @@ pub const Target = struct { |
| 234 | 234 | .max = .{ .major = 12, .minor = 1 }, |
| 235 | 235 | }, |
| 236 | 236 | }, |
| 237 | .macosx => return .{ | |
| 237 | .macos => return .{ | |
| 238 | 238 | .semver = .{ |
| 239 | 239 | .min = .{ .major = 10, .minor = 13 }, |
| 240 | 240 | .max = .{ .major = 10, .minor = 15, .patch = 3 }, |
| ... | ... | @@ -312,7 +312,7 @@ pub const Target = struct { |
| 312 | 312 | .windows => return TaggedVersionRange{ .windows = self.version_range.windows }, |
| 313 | 313 | |
| 314 | 314 | .freebsd, |
| 315 | .macosx, | |
| 315 | .macos, | |
| 316 | 316 | .ios, |
| 317 | 317 | .tvos, |
| 318 | 318 | .watchos, |
| ... | ... | @@ -341,7 +341,7 @@ pub const Target = struct { |
| 341 | 341 | return switch (os.tag) { |
| 342 | 342 | .freebsd, |
| 343 | 343 | .netbsd, |
| 344 | .macosx, | |
| 344 | .macos, | |
| 345 | 345 | .ios, |
| 346 | 346 | .tvos, |
| 347 | 347 | .watchos, |
| ... | ... | @@ -450,7 +450,7 @@ pub const Target = struct { |
| 450 | 450 | .other, |
| 451 | 451 | => return .eabi, |
| 452 | 452 | .openbsd, |
| 453 | .macosx, | |
| 453 | .macos, | |
| 454 | 454 | .freebsd, |
| 455 | 455 | .ios, |
| 456 | 456 | .tvos, |
| ... | ... | @@ -1277,7 +1277,7 @@ pub const Target = struct { |
| 1277 | 1277 | .ios, |
| 1278 | 1278 | .tvos, |
| 1279 | 1279 | .watchos, |
| 1280 | .macosx, | |
| 1280 | .macos, | |
| 1281 | 1281 | .uefi, |
| 1282 | 1282 | .windows, |
| 1283 | 1283 | .emscripten, |
| ... | ... | @@ -1450,7 +1450,7 @@ pub const Target = struct { |
| 1450 | 1450 | .ios, |
| 1451 | 1451 | .tvos, |
| 1452 | 1452 | .watchos, |
| 1453 | .macosx, | |
| 1453 | .macos, | |
| 1454 | 1454 | .uefi, |
| 1455 | 1455 | .windows, |
| 1456 | 1456 | .emscripten, |
lib/std/time.zig+1-1| ... | ... | @@ -143,7 +143,7 @@ pub const Timer = struct { |
| 143 | 143 | /// be less precise |
| 144 | 144 | frequency: switch (builtin.os.tag) { |
| 145 | 145 | .windows => u64, |
| 146 | .macosx, .ios, .tvos, .watchos => os.darwin.mach_timebase_info_data, | |
| 146 | .macos, .ios, .tvos, .watchos => os.darwin.mach_timebase_info_data, | |
| 147 | 147 | else => void, |
| 148 | 148 | }, |
| 149 | 149 | resolution: u64, |
lib/std/zig/cross_target.zig+3-3| ... | ... | @@ -137,7 +137,7 @@ pub const CrossTarget = struct { |
| 137 | 137 | }, |
| 138 | 138 | |
| 139 | 139 | .freebsd, |
| 140 | .macosx, | |
| 140 | .macos, | |
| 141 | 141 | .ios, |
| 142 | 142 | .tvos, |
| 143 | 143 | .watchos, |
| ... | ... | @@ -578,7 +578,7 @@ pub const CrossTarget = struct { |
| 578 | 578 | const os = switch (self.getOsTag()) { |
| 579 | 579 | .windows => "windows", |
| 580 | 580 | .linux => "linux", |
| 581 | .macosx => "macos", | |
| 581 | .macos => "macos", | |
| 582 | 582 | else => return error.UnsupportedVcpkgOperatingSystem, |
| 583 | 583 | }; |
| 584 | 584 | |
| ... | ... | @@ -718,7 +718,7 @@ pub const CrossTarget = struct { |
| 718 | 718 | => return error.InvalidOperatingSystemVersion, |
| 719 | 719 | |
| 720 | 720 | .freebsd, |
| 721 | .macosx, | |
| 721 | .macos, | |
| 722 | 722 | .ios, |
| 723 | 723 | .tvos, |
| 724 | 724 | .watchos, |
lib/std/zig/system.zig+1-1| ... | ... | @@ -267,7 +267,7 @@ pub const NativeTargetInfo = struct { |
| 267 | 267 | os.version_range.windows.max = @intToEnum(Target.Os.WindowsVersion, version); |
| 268 | 268 | os.version_range.windows.min = @intToEnum(Target.Os.WindowsVersion, version); |
| 269 | 269 | }, |
| 270 | .macosx => { | |
| 270 | .macos => { | |
| 271 | 271 | var scbuf: [32]u8 = undefined; |
| 272 | 272 | var size: usize = undefined; |
| 273 | 273 |
src/codegen/llvm.zig+1-1| ... | ... | @@ -69,7 +69,7 @@ pub fn targetTriple(allocator: *Allocator, target: std.Target) ![]u8 { |
| 69 | 69 | .kfreebsd => "kfreebsd", |
| 70 | 70 | .linux => "linux", |
| 71 | 71 | .lv2 => "lv2", |
| 72 | .macosx => "macosx", | |
| 72 | .macos => "macosx", | |
| 73 | 73 | .netbsd => "netbsd", |
| 74 | 74 | .openbsd => "openbsd", |
| 75 | 75 | .solaris => "solaris", |
src/link/MachO.zig+1-1| ... | ... | @@ -525,7 +525,7 @@ fn linkWithLLD(self: *MachO, comp: *Compilation) !void { |
| 525 | 525 | try argv.append(darwinArchString(target.cpu.arch)); |
| 526 | 526 | |
| 527 | 527 | switch (target.os.tag) { |
| 528 | .macosx => { | |
| 528 | .macos => { | |
| 529 | 529 | try argv.append("-macosx_version_min"); |
| 530 | 530 | }, |
| 531 | 531 | .ios, .tvos, .watchos => switch (target.cpu.arch) { |
src/target.zig+3-3| ... | ... | @@ -123,14 +123,14 @@ pub fn cannotDynamicLink(target: std.Target) bool { |
| 123 | 123 | /// since this is the stable syscall interface. |
| 124 | 124 | pub fn osRequiresLibC(target: std.Target) bool { |
| 125 | 125 | return switch (target.os.tag) { |
| 126 | .freebsd, .netbsd, .dragonfly, .macosx, .ios, .watchos, .tvos => true, | |
| 126 | .freebsd, .netbsd, .dragonfly, .macos, .ios, .watchos, .tvos => true, | |
| 127 | 127 | else => false, |
| 128 | 128 | }; |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | pub fn libcNeedsLibUnwind(target: std.Target) bool { |
| 132 | 132 | return switch (target.os.tag) { |
| 133 | .macosx, | |
| 133 | .macos, | |
| 134 | 134 | .ios, |
| 135 | 135 | .watchos, |
| 136 | 136 | .tvos, |
| ... | ... | @@ -197,7 +197,7 @@ pub fn osToLLVM(os_tag: std.Target.Os.Tag) llvm.OSType { |
| 197 | 197 | .kfreebsd => .KFreeBSD, |
| 198 | 198 | .linux => .Linux, |
| 199 | 199 | .lv2 => .Lv2, |
| 200 | .macosx => .MacOSX, | |
| 200 | .macos => .MacOSX, | |
| 201 | 201 | .netbsd => .NetBSD, |
| 202 | 202 | .openbsd => .OpenBSD, |
| 203 | 203 | .solaris => .Solaris, |
src/type.zig+1-1| ... | ... | @@ -3104,7 +3104,7 @@ pub const CType = enum { |
| 3104 | 3104 | }, |
| 3105 | 3105 | |
| 3106 | 3106 | .linux, |
| 3107 | .macosx, | |
| 3107 | .macos, | |
| 3108 | 3108 | .freebsd, |
| 3109 | 3109 | .netbsd, |
| 3110 | 3110 | .dragonfly, |
src/zig_llvm.cpp+3-1| ... | ... | @@ -817,7 +817,9 @@ const char *ZigLLVMGetVendorTypeName(ZigLLVM_VendorType vendor) { |
| 817 | 817 | } |
| 818 | 818 | |
| 819 | 819 | const char *ZigLLVMGetOSTypeName(ZigLLVM_OSType os) { |
| 820 | return (const char*)Triple::getOSTypeName((Triple::OSType)os).bytes_begin(); | |
| 820 | const char* name = (const char*)Triple::getOSTypeName((Triple::OSType)os).bytes_begin(); | |
| 821 | if (strcmp(name, "macosx") == 0) return "macos"; | |
| 822 | return name; | |
| 821 | 823 | } |
| 822 | 824 | |
| 823 | 825 | const char *ZigLLVMGetEnvironmentTypeName(ZigLLVM_EnvironmentType env_type) { |
test/stack_traces.zig+1-1| ... | ... | @@ -308,7 +308,7 @@ pub fn addCases(cases: *tests.StackTracesContext) void { |
| 308 | 308 | }, |
| 309 | 309 | ); |
| 310 | 310 | }, |
| 311 | .macosx => { | |
| 311 | .macos => { | |
| 312 | 312 | cases.addCase( |
| 313 | 313 | "return", |
| 314 | 314 | source_return, |
test/stage2/test.zig+1-1| ... | ... | @@ -13,7 +13,7 @@ const linux_x64 = std.zig.CrossTarget{ |
| 13 | 13 | |
| 14 | 14 | const macosx_x64 = std.zig.CrossTarget{ |
| 15 | 15 | .cpu_arch = .x86_64, |
| 16 | .os_tag = .macosx, | |
| 16 | .os_tag = .macos, | |
| 17 | 17 | }; |
| 18 | 18 | |
| 19 | 19 | const linux_riscv64 = std.zig.CrossTarget{ |
test/tests.zig+1-1| ... | ... | @@ -234,7 +234,7 @@ const test_targets = blk: { |
| 234 | 234 | TestTarget{ |
| 235 | 235 | .target = .{ |
| 236 | 236 | .cpu_arch = .x86_64, |
| 237 | .os_tag = .macosx, | |
| 237 | .os_tag = .macos, | |
| 238 | 238 | .abi = .gnu, |
| 239 | 239 | }, |
| 240 | 240 | // https://github.com/ziglang/zig/issues/3295 |