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