Commit 2ab0c7391a

Vignesh Rajagopalan <me@aarvay.com>
2020-10-12 10:59:43
Rename .macosx to .macos
1 parent 53c63bd
lib/std/event/loop.zig
@@ -66,7 +66,7 @@ pub const Loop = struct {
         };
 
         pub const EventFd = switch (builtin.os.tag) {
-            .macosx, .freebsd, .netbsd, .dragonfly => KEventFd,
+            .macos, .freebsd, .netbsd, .dragonfly => KEventFd,
             .linux => struct {
                 base: ResumeNode,
                 epoll_op: u32,
@@ -85,7 +85,7 @@ pub const Loop = struct {
         };
 
         pub const Basic = switch (builtin.os.tag) {
-            .macosx, .freebsd, .netbsd, .dragonfly => KEventBasic,
+            .macos, .freebsd, .netbsd, .dragonfly => KEventBasic,
             .linux => struct {
                 base: ResumeNode,
             },
@@ -259,7 +259,7 @@ pub const Loop = struct {
                     self.extra_threads[extra_thread_index] = try Thread.spawn(self, workerRun);
                 }
             },
-            .macosx, .freebsd, .netbsd, .dragonfly => {
+            .macos, .freebsd, .netbsd, .dragonfly => {
                 self.os_data.kqfd = try os.kqueue();
                 errdefer os.close(self.os_data.kqfd);
 
@@ -384,7 +384,7 @@ pub const Loop = struct {
                 while (self.available_eventfd_resume_nodes.pop()) |node| os.close(node.data.eventfd);
                 os.close(self.os_data.epollfd);
             },
-            .macosx, .freebsd, .netbsd, .dragonfly => {
+            .macos, .freebsd, .netbsd, .dragonfly => {
                 os.close(self.os_data.kqfd);
             },
             .windows => {
@@ -478,7 +478,7 @@ pub const Loop = struct {
             .linux => {
                 self.linuxWaitFd(fd, os.EPOLLET | os.EPOLLONESHOT | os.EPOLLIN);
             },
-            .macosx, .freebsd, .netbsd, .dragonfly => {
+            .macos, .freebsd, .netbsd, .dragonfly => {
                 self.bsdWaitKev(@intCast(usize, fd), os.EVFILT_READ, os.EV_ONESHOT);
             },
             else => @compileError("Unsupported OS"),
@@ -490,7 +490,7 @@ pub const Loop = struct {
             .linux => {
                 self.linuxWaitFd(fd, os.EPOLLET | os.EPOLLONESHOT | os.EPOLLOUT);
             },
-            .macosx, .freebsd, .netbsd, .dragonfly => {
+            .macos, .freebsd, .netbsd, .dragonfly => {
                 self.bsdWaitKev(@intCast(usize, fd), os.EVFILT_WRITE, os.EV_ONESHOT);
             },
             else => @compileError("Unsupported OS"),
@@ -502,7 +502,7 @@ pub const Loop = struct {
             .linux => {
                 self.linuxWaitFd(fd, os.EPOLLET | os.EPOLLONESHOT | os.EPOLLOUT | os.EPOLLIN);
             },
-            .macosx, .freebsd, .netbsd, .dragonfly => {
+            .macos, .freebsd, .netbsd, .dragonfly => {
                 self.bsdWaitKev(@intCast(usize, fd), os.EVFILT_READ, os.EV_ONESHOT);
                 self.bsdWaitKev(@intCast(usize, fd), os.EVFILT_WRITE, os.EV_ONESHOT);
             },
@@ -571,7 +571,7 @@ pub const Loop = struct {
             const eventfd_node = &resume_stack_node.data;
             eventfd_node.base.handle = next_tick_node.data;
             switch (builtin.os.tag) {
-                .macosx, .freebsd, .netbsd, .dragonfly => {
+                .macos, .freebsd, .netbsd, .dragonfly => {
                     const kevent_array = @as(*const [1]os.Kevent, &eventfd_node.kevent);
                     const empty_kevs = &[0]os.Kevent{};
                     _ = os.kevent(self.os_data.kqfd, kevent_array, empty_kevs, null) catch {
@@ -633,7 +633,7 @@ pub const Loop = struct {
         if (!builtin.single_threaded) {
             switch (builtin.os.tag) {
                 .linux,
-                .macosx,
+                .macos,
                 .freebsd,
                 .netbsd,
                 .dragonfly,
@@ -725,7 +725,7 @@ pub const Loop = struct {
                     }
                     return;
                 },
-                .macosx, .freebsd, .netbsd, .dragonfly => {
+                .macos, .freebsd, .netbsd, .dragonfly => {
                     const final_kevent = @as(*const [1]os.Kevent, &self.os_data.final_kevent);
                     const empty_kevs = &[0]os.Kevent{};
                     // cannot fail because we already added it and this just enables it
@@ -1218,7 +1218,7 @@ pub const Loop = struct {
                         }
                     }
                 },
-                .macosx, .freebsd, .netbsd, .dragonfly => {
+                .macos, .freebsd, .netbsd, .dragonfly => {
                     var eventlist: [1]os.Kevent = undefined;
                     const empty_kevs = &[0]os.Kevent{};
                     const count = os.kevent(self.os_data.kqfd, empty_kevs, eventlist[0..], null) catch unreachable;
@@ -1344,7 +1344,7 @@ pub const Loop = struct {
 
     const OsData = switch (builtin.os.tag) {
         .linux => LinuxOsData,
-        .macosx, .freebsd, .netbsd, .dragonfly => KEventData,
+        .macos, .freebsd, .netbsd, .dragonfly => KEventData,
         .windows => struct {
             io_port: windows.HANDLE,
             extra_thread_count: usize,
lib/std/fs/get_app_data_dir.zig
@@ -42,7 +42,7 @@ pub fn getAppDataDir(allocator: *mem.Allocator, appname: []const u8) GetAppDataD
                 else => return error.AppDataDirUnavailable,
             }
         },
-        .macosx => {
+        .macos => {
             const home_dir = os.getenv("HOME") orelse {
                 // TODO look in /etc/passwd
                 return error.AppDataDirUnavailable;
lib/std/fs/test.zig
@@ -143,7 +143,7 @@ fn contains(entries: *const std.ArrayList(Dir.Entry), el: Dir.Entry) bool {
 
 test "Dir.realpath smoke test" {
     switch (builtin.os.tag) {
-        .linux, .windows, .macosx, .ios, .watchos, .tvos => {},
+        .linux, .windows, .macos, .ios, .watchos, .tvos => {},
         else => return error.SkipZigTest,
     }
 
lib/std/fs/watch.zig
@@ -49,7 +49,7 @@ pub fn Watch(comptime V: type) type {
 
         const OsData = switch (builtin.os.tag) {
             // TODO https://github.com/ziglang/zig/issues/3778
-            .macosx, .freebsd, .netbsd, .dragonfly => KqOsData,
+            .macos, .freebsd, .netbsd, .dragonfly => KqOsData,
             .linux => LinuxOsData,
             .windows => WindowsOsData,
 
@@ -160,7 +160,7 @@ pub fn Watch(comptime V: type) type {
                     return self;
                 },
 
-                .macosx, .freebsd, .netbsd, .dragonfly => {
+                .macos, .freebsd, .netbsd, .dragonfly => {
                     self.* = Self{
                         .allocator = allocator,
                         .channel = channel,
@@ -178,7 +178,7 @@ pub fn Watch(comptime V: type) type {
         /// All addFile calls and removeFile calls must have completed.
         pub fn deinit(self: *Self) void {
             switch (builtin.os.tag) {
-                .macosx, .freebsd, .netbsd, .dragonfly => {
+                .macos, .freebsd, .netbsd, .dragonfly => {
                     // TODO we need to cancel the frames before destroying the lock
                     self.os_data.table_lock.deinit();
                     var it = self.os_data.file_table.iterator();
@@ -229,7 +229,7 @@ pub fn Watch(comptime V: type) type {
 
         pub fn addFile(self: *Self, file_path: []const u8, value: V) !?V {
             switch (builtin.os.tag) {
-                .macosx, .freebsd, .netbsd, .dragonfly => return addFileKEvent(self, file_path, value),
+                .macos, .freebsd, .netbsd, .dragonfly => return addFileKEvent(self, file_path, value),
                 .linux => return addFileLinux(self, file_path, value),
                 .windows => return addFileWindows(self, file_path, value),
                 else => @compileError("Unsupported OS"),
lib/std/os/bits.zig
@@ -12,7 +12,7 @@ const std = @import("std");
 const root = @import("root");
 
 pub usingnamespace switch (std.Target.current.os.tag) {
-    .macosx, .ios, .tvos, .watchos => @import("bits/darwin.zig"),
+    .macos, .ios, .tvos, .watchos => @import("bits/darwin.zig"),
     .dragonfly => @import("bits/dragonfly.zig"),
     .freebsd => @import("bits/freebsd.zig"),
     .linux => @import("bits/linux.zig"),
lib/std/os/test.zig
@@ -360,7 +360,7 @@ fn iter_fn(info: *dl_phdr_info, size: usize, counter: *usize) IterFnError!void {
 }
 
 test "dl_iterate_phdr" {
-    if (builtin.os.tag == .windows or builtin.os.tag == .wasi or builtin.os.tag == .macosx)
+    if (builtin.os.tag == .windows or builtin.os.tag == .wasi or builtin.os.tag == .macos)
         return error.SkipZigTest;
 
     var counter: usize = 0;
lib/std/special/compiler_rt/clear_cache.zig
@@ -44,7 +44,7 @@ pub fn clear_cache(start: usize, end: usize) callconv(.C) void {
         else => false,
     };
     const apple = switch (os) {
-        .ios, .macosx, .watchos, .tvos => true,
+        .ios, .macos, .watchos, .tvos => true,
         else => false,
     };
     if (x86) {
lib/std/zig/cross_target.zig
@@ -137,7 +137,7 @@ pub const CrossTarget = struct {
             },
 
             .freebsd,
-            .macosx,
+            .macos,
             .ios,
             .tvos,
             .watchos,
@@ -578,7 +578,7 @@ pub const CrossTarget = struct {
         const os = switch (self.getOsTag()) {
             .windows => "windows",
             .linux => "linux",
-            .macosx => "macos",
+            .macos => "macos",
             else => return error.UnsupportedVcpkgOperatingSystem,
         };
 
@@ -718,7 +718,7 @@ pub const CrossTarget = struct {
             => return error.InvalidOperatingSystemVersion,
 
             .freebsd,
-            .macosx,
+            .macos,
             .ios,
             .tvos,
             .watchos,
lib/std/zig/system.zig
@@ -267,7 +267,7 @@ pub const NativeTargetInfo = struct {
                     os.version_range.windows.max = @intToEnum(Target.Os.WindowsVersion, version);
                     os.version_range.windows.min = @intToEnum(Target.Os.WindowsVersion, version);
                 },
-                .macosx => {
+                .macos => {
                     var scbuf: [32]u8 = undefined;
                     var size: usize = undefined;
 
lib/std/c.zig
@@ -22,7 +22,7 @@ pub usingnamespace @import("os/bits.zig");
 pub usingnamespace switch (std.Target.current.os.tag) {
     .linux => @import("c/linux.zig"),
     .windows => @import("c/windows.zig"),
-    .macosx, .ios, .tvos, .watchos => @import("c/darwin.zig"),
+    .macos, .ios, .tvos, .watchos => @import("c/darwin.zig"),
     .freebsd, .kfreebsd => @import("c/freebsd.zig"),
     .netbsd => @import("c/netbsd.zig"),
     .dragonfly => @import("c/dragonfly.zig"),
@@ -122,7 +122,7 @@ pub extern "c" fn readlink(noalias path: [*:0]const u8, noalias buf: [*]u8, bufs
 pub extern "c" fn readlinkat(dirfd: fd_t, noalias path: [*:0]const u8, noalias buf: [*]u8, bufsize: usize) isize;
 
 pub usingnamespace switch (builtin.os.tag) {
-    .macosx, .ios, .watchos, .tvos => struct {
+    .macos, .ios, .watchos, .tvos => struct {
         pub const realpath = @"realpath$DARWIN_EXTSN";
         pub const fstatat = @"fstatat$INODE64";
     },
@@ -189,7 +189,7 @@ pub usingnamespace switch (builtin.os.tag) {
         pub const sigprocmask = __sigprocmask14;
         pub const stat = __stat50;
     },
-    .macosx, .ios, .watchos, .tvos => struct {
+    .macos, .ios, .watchos, .tvos => struct {
         // XXX: close -> close$NOCANCEL
         // XXX: getdirentries -> _getdirentries64
         pub extern "c" fn clock_getres(clk_id: c_int, tp: *timespec) c_int;
@@ -252,7 +252,7 @@ pub usingnamespace switch (builtin.os.tag) {
     .linux, .freebsd, .kfreebsd, .netbsd, .openbsd => struct {
         pub extern "c" fn malloc_usable_size(?*const c_void) usize;
     },
-    .macosx, .ios, .watchos, .tvos => struct {
+    .macos, .ios, .watchos, .tvos => struct {
         pub extern "c" fn malloc_size(?*const c_void) usize;
     },
     else => struct {},
lib/std/debug.zig
@@ -654,7 +654,7 @@ pub fn openSelfDebugInfo(allocator: *mem.Allocator) anyerror!DebugInfo {
             .freebsd,
             .netbsd,
             .dragonfly,
-            .macosx,
+            .macos,
             .windows,
             => return DebugInfo.init(allocator),
             else => @compileError("openSelfDebugInfo unsupported for this platform"),
@@ -1320,7 +1320,7 @@ const SymbolInfo = struct {
 };
 
 pub const ModuleDebugInfo = switch (builtin.os.tag) {
-    .macosx, .ios, .watchos, .tvos => struct {
+    .macos, .ios, .watchos, .tvos => struct {
         base_address: usize,
         mapped_memory: []const u8,
         symbols: []const MachoSymbol,
lib/std/dynamic_library.zig
@@ -19,7 +19,7 @@ const max = std.math.max;
 pub const DynLib = switch (builtin.os.tag) {
     .linux => if (builtin.link_libc) DlDynlib else ElfDynLib,
     .windows => WindowsDynLib,
-    .macosx, .tvos, .watchos, .ios, .freebsd => DlDynlib,
+    .macos, .tvos, .watchos, .ios, .freebsd => DlDynlib,
     else => void,
 };
 
@@ -404,7 +404,7 @@ test "dynamic_library" {
     const libname = switch (builtin.os.tag) {
         .linux, .freebsd => "invalid_so.so",
         .windows => "invalid_dll.dll",
-        .macosx, .tvos, .watchos, .ios => "invalid_dylib.dylib",
+        .macos, .tvos, .watchos, .ios => "invalid_dylib.dylib",
         else => return error.SkipZigTest,
     };
 
lib/std/fs.zig
@@ -39,7 +39,7 @@ pub const Watch = @import("fs/watch.zig").Watch;
 /// fit into a UTF-8 encoded array of this length.
 /// The byte count includes room for a null sentinel byte.
 pub const MAX_PATH_BYTES = switch (builtin.os.tag) {
-    .linux, .macosx, .ios, .freebsd, .netbsd, .dragonfly => os.PATH_MAX,
+    .linux, .macos, .ios, .freebsd, .netbsd, .dragonfly => os.PATH_MAX,
     // Each UTF-16LE character may be expanded to 3 UTF-8 bytes.
     // If it would require 4 UTF-8 bytes, then there would be a surrogate
     // pair in the UTF-16LE, and we (over)account 3 bytes for it that way.
@@ -303,7 +303,7 @@ pub const Dir = struct {
     const IteratorError = error{AccessDenied} || os.UnexpectedError;
 
     pub const Iterator = switch (builtin.os.tag) {
-        .macosx, .ios, .freebsd, .netbsd, .dragonfly => struct {
+        .macos, .ios, .freebsd, .netbsd, .dragonfly => struct {
             dir: Dir,
             seek: i64,
             buf: [8192]u8, // TODO align(@alignOf(os.dirent)),
@@ -318,7 +318,7 @@ pub const Dir = struct {
             /// with subsequent calls to `next`, as well as when this `Dir` is deinitialized.
             pub fn next(self: *Self) Error!?Entry {
                 switch (builtin.os.tag) {
-                    .macosx, .ios => return self.nextDarwin(),
+                    .macos, .ios => return self.nextDarwin(),
                     .freebsd, .netbsd, .dragonfly => return self.nextBsd(),
                     else => @compileError("unimplemented"),
                 }
@@ -615,7 +615,7 @@ pub const Dir = struct {
 
     pub fn iterate(self: Dir) Iterator {
         switch (builtin.os.tag) {
-            .macosx, .ios, .freebsd, .netbsd, .dragonfly => return Iterator{
+            .macos, .ios, .freebsd, .netbsd, .dragonfly => return Iterator{
                 .dir = self,
                 .seek = 0,
                 .index = 0,
@@ -1302,7 +1302,7 @@ pub const Dir = struct {
             error.AccessDenied => |e| switch (builtin.os.tag) {
                 // non-Linux POSIX systems return EPERM when trying to delete a directory, so
                 // we need to handle that case specifically and translate the error
-                .macosx, .ios, .freebsd, .netbsd, .dragonfly => {
+                .macos, .ios, .freebsd, .netbsd, .dragonfly => {
                     // Don't follow symlinks to match unlinkat (which acts on symlinks rather than follows them)
                     const fstat = os.fstatatZ(self.fd, sub_path_c, os.AT_SYMLINK_NOFOLLOW) catch return e;
                     const is_dir = fstat.mode & os.S_IFMT == os.S_IFDIR;
lib/std/os.zig
@@ -62,7 +62,7 @@ pub const system = if (@hasDecl(root, "os") and root.os != @This())
 else if (builtin.link_libc)
     std.c
 else switch (builtin.os.tag) {
-    .macosx, .ios, .watchos, .tvos => darwin,
+    .macos, .ios, .watchos, .tvos => darwin,
     .freebsd => freebsd,
     .linux => linux,
     .netbsd => netbsd,
@@ -354,7 +354,7 @@ pub fn read(fd: fd_t, buf: []u8) ReadError!usize {
     // Prevents EINVAL.
     const max_count = switch (std.Target.current.os.tag) {
         .linux => 0x7ffff000,
-        .macosx, .ios, .watchos, .tvos => math.maxInt(i32),
+        .macos, .ios, .watchos, .tvos => math.maxInt(i32),
         else => math.maxInt(isize),
     };
     const adjusted_len = math.min(max_count, buf.len);
@@ -582,7 +582,7 @@ pub fn ftruncate(fd: fd_t, length: u64) TruncateError!void {
 /// On these systems, the read races with concurrent writes to the same file descriptor.
 pub fn preadv(fd: fd_t, iov: []const iovec, offset: u64) PReadError!usize {
     const have_pread_but_not_preadv = switch (std.Target.current.os.tag) {
-        .windows, .macosx, .ios, .watchos, .tvos => true,
+        .windows, .macos, .ios, .watchos, .tvos => true,
         else => false,
     };
     if (have_pread_but_not_preadv) {
@@ -709,7 +709,7 @@ pub fn write(fd: fd_t, bytes: []const u8) WriteError!usize {
 
     const max_count = switch (std.Target.current.os.tag) {
         .linux => 0x7ffff000,
-        .macosx, .ios, .watchos, .tvos => math.maxInt(i32),
+        .macos, .ios, .watchos, .tvos => math.maxInt(i32),
         else => math.maxInt(isize),
     };
     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 {
     // Prevent EINVAL.
     const max_count = switch (std.Target.current.os.tag) {
         .linux => 0x7ffff000,
-        .macosx, .ios, .watchos, .tvos => math.maxInt(i32),
+        .macos, .ios, .watchos, .tvos => math.maxInt(i32),
         else => math.maxInt(isize),
     };
     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 {
 /// If `iov.len` is larger than will fit in a `u31`, a partial write will occur.
 pub fn pwritev(fd: fd_t, iov: []const iovec_const, offset: u64) PWriteError!usize {
     const have_pwrite_but_not_pwritev = switch (std.Target.current.os.tag) {
-        .windows, .macosx, .ios, .watchos, .tvos => true,
+        .windows, .macos, .ios, .watchos, .tvos => true,
         else => false,
     };
 
@@ -4091,7 +4091,7 @@ pub fn getFdPath(fd: fd_t, out_buffer: *[MAX_PATH_BYTES]u8) RealPathError![]u8 {
             const end_index = std.unicode.utf16leToUtf8(out_buffer, wide_slice) catch unreachable;
             return out_buffer[0..end_index];
         },
-        .macosx, .ios, .watchos, .tvos => {
+        .macos, .ios, .watchos, .tvos => {
             // On macOS, we can use F_GETPATH fcntl command to query the OS for
             // the path to the file descriptor.
             @memset(out_buffer, 0, MAX_PATH_BYTES);
@@ -4688,7 +4688,7 @@ pub fn sendfile(
     });
     const max_count = switch (std.Target.current.os.tag) {
         .linux => 0x7ffff000,
-        .macosx, .ios, .watchos, .tvos => math.maxInt(i32),
+        .macos, .ios, .watchos, .tvos => math.maxInt(i32),
         else => math.maxInt(size_t),
     };
 
@@ -4846,7 +4846,7 @@ pub fn sendfile(
                 }
             }
         },
-        .macosx, .ios, .tvos, .watchos => sf: {
+        .macos, .ios, .tvos, .watchos => sf: {
             var hdtr_data: std.c.sf_hdtr = undefined;
             var hdtr: ?*std.c.sf_hdtr = null;
             if (headers.len != 0 or trailers.len != 0) {
lib/std/packed_int_array.zig
@@ -618,7 +618,7 @@ test "PackedIntArray at end of available memory" {
     if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest;
 
     switch (builtin.os.tag) {
-        .linux, .macosx, .ios, .freebsd, .netbsd, .windows => {},
+        .linux, .macos, .ios, .freebsd, .netbsd, .windows => {},
         else => return,
     }
     const PackedArray = PackedIntArray(u3, 8);
@@ -639,7 +639,7 @@ test "PackedIntSlice at end of available memory" {
     if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest;
 
     switch (builtin.os.tag) {
-        .linux, .macosx, .ios, .freebsd, .netbsd, .windows => {},
+        .linux, .macos, .ios, .freebsd, .netbsd, .windows => {},
         else => return,
     }
     const PackedSlice = PackedIntSlice(u11);
lib/std/process.zig
@@ -585,7 +585,7 @@ pub const UserInfo = struct {
 /// POSIX function which gets a uid from username.
 pub fn getUserInfo(name: []const u8) !UserInfo {
     return switch (builtin.os.tag) {
-        .linux, .macosx, .watchos, .tvos, .ios, .freebsd, .netbsd => posixGetUserInfo(name),
+        .linux, .macos, .watchos, .tvos, .ios, .freebsd, .netbsd => posixGetUserInfo(name),
         else => @compileError("Unsupported OS"),
     };
 }
@@ -688,7 +688,7 @@ pub fn getBaseAddress() usize {
             const phdr = os.system.getauxval(std.elf.AT_PHDR);
             return phdr - @sizeOf(std.elf.Ehdr);
         },
-        .macosx, .freebsd, .netbsd => {
+        .macos, .freebsd, .netbsd => {
             return @ptrToInt(&std.c._mh_execute_header);
         },
         .windows => return @ptrToInt(os.windows.kernel32.GetModuleHandleW(null)),
@@ -733,7 +733,7 @@ pub fn getSelfExeSharedLibPaths(allocator: *Allocator) error{OutOfMemory}![][:0]
             }.callback);
             return paths.toOwnedSlice();
         },
-        .macosx, .ios, .watchos, .tvos => {
+        .macos, .ios, .watchos, .tvos => {
             var paths = List.init(allocator);
             errdefer {
                 const slice = paths.toOwnedSlice();
lib/std/target.zig
@@ -31,7 +31,7 @@ pub const Target = struct {
             kfreebsd,
             linux,
             lv2,
-            macosx,
+            macos,
             netbsd,
             openbsd,
             solaris,
@@ -61,7 +61,7 @@ pub const Target = struct {
 
             pub fn isDarwin(tag: Tag) bool {
                 return switch (tag) {
-                    .ios, .macosx, .watchos, .tvos => true,
+                    .ios, .macos, .watchos, .tvos => true,
                     else => false,
                 };
             }
@@ -234,7 +234,7 @@ pub const Target = struct {
                             .max = .{ .major = 12, .minor = 1 },
                         },
                     },
-                    .macosx => return .{
+                    .macos => return .{
                         .semver = .{
                             .min = .{ .major = 10, .minor = 13 },
                             .max = .{ .major = 10, .minor = 15, .patch = 3 },
@@ -312,7 +312,7 @@ pub const Target = struct {
                 .windows => return TaggedVersionRange{ .windows = self.version_range.windows },
 
                 .freebsd,
-                .macosx,
+                .macos,
                 .ios,
                 .tvos,
                 .watchos,
@@ -341,7 +341,7 @@ pub const Target = struct {
             return switch (os.tag) {
                 .freebsd,
                 .netbsd,
-                .macosx,
+                .macos,
                 .ios,
                 .tvos,
                 .watchos,
@@ -450,7 +450,7 @@ pub const Target = struct {
                 .other,
                 => return .eabi,
                 .openbsd,
-                .macosx,
+                .macos,
                 .freebsd,
                 .ios,
                 .tvos,
@@ -1277,7 +1277,7 @@ pub const Target = struct {
             .ios,
             .tvos,
             .watchos,
-            .macosx,
+            .macos,
             .uefi,
             .windows,
             .emscripten,
@@ -1450,7 +1450,7 @@ pub const Target = struct {
             .ios,
             .tvos,
             .watchos,
-            .macosx,
+            .macos,
             .uefi,
             .windows,
             .emscripten,
lib/std/time.zig
@@ -143,7 +143,7 @@ pub const Timer = struct {
     ///  be less precise
     frequency: switch (builtin.os.tag) {
         .windows => u64,
-        .macosx, .ios, .tvos, .watchos => os.darwin.mach_timebase_info_data,
+        .macos, .ios, .tvos, .watchos => os.darwin.mach_timebase_info_data,
         else => void,
     },
     resolution: u64,
src/codegen/llvm.zig
@@ -69,7 +69,7 @@ pub fn targetTriple(allocator: *Allocator, target: std.Target) ![]u8 {
         .kfreebsd => "kfreebsd",
         .linux => "linux",
         .lv2 => "lv2",
-        .macosx => "macosx",
+        .macos => "macosx",
         .netbsd => "netbsd",
         .openbsd => "openbsd",
         .solaris => "solaris",
src/link/MachO.zig
@@ -525,7 +525,7 @@ fn linkWithLLD(self: *MachO, comp: *Compilation) !void {
         try argv.append(darwinArchString(target.cpu.arch));
 
         switch (target.os.tag) {
-            .macosx => {
+            .macos => {
                 try argv.append("-macosx_version_min");
             },
             .ios, .tvos, .watchos => switch (target.cpu.arch) {
src/target.zig
@@ -123,14 +123,14 @@ pub fn cannotDynamicLink(target: std.Target) bool {
 /// since this is the stable syscall interface.
 pub fn osRequiresLibC(target: std.Target) bool {
     return switch (target.os.tag) {
-        .freebsd, .netbsd, .dragonfly, .macosx, .ios, .watchos, .tvos => true,
+        .freebsd, .netbsd, .dragonfly, .macos, .ios, .watchos, .tvos => true,
         else => false,
     };
 }
 
 pub fn libcNeedsLibUnwind(target: std.Target) bool {
     return switch (target.os.tag) {
-        .macosx,
+        .macos,
         .ios,
         .watchos,
         .tvos,
@@ -197,7 +197,7 @@ pub fn osToLLVM(os_tag: std.Target.Os.Tag) llvm.OSType {
         .kfreebsd => .KFreeBSD,
         .linux => .Linux,
         .lv2 => .Lv2,
-        .macosx => .MacOSX,
+        .macos => .MacOSX,
         .netbsd => .NetBSD,
         .openbsd => .OpenBSD,
         .solaris => .Solaris,
src/type.zig
@@ -3104,7 +3104,7 @@ pub const CType = enum {
             },
 
             .linux,
-            .macosx,
+            .macos,
             .freebsd,
             .netbsd,
             .dragonfly,
src/zig_llvm.cpp
@@ -817,7 +817,9 @@ const char *ZigLLVMGetVendorTypeName(ZigLLVM_VendorType vendor) {
 }
 
 const char *ZigLLVMGetOSTypeName(ZigLLVM_OSType os) {
-    return (const char*)Triple::getOSTypeName((Triple::OSType)os).bytes_begin();
+    const char* name = (const char*)Triple::getOSTypeName((Triple::OSType)os).bytes_begin();
+    if (strcmp(name, "macosx") == 0) return "macos";
+    return name;
 }
 
 const char *ZigLLVMGetEnvironmentTypeName(ZigLLVM_EnvironmentType env_type) {
test/stage2/test.zig
@@ -13,7 +13,7 @@ const linux_x64 = std.zig.CrossTarget{
 
 const macosx_x64 = std.zig.CrossTarget{
     .cpu_arch = .x86_64,
-    .os_tag = .macosx,
+    .os_tag = .macos,
 };
 
 const linux_riscv64 = std.zig.CrossTarget{
test/stack_traces.zig
@@ -308,7 +308,7 @@ pub fn addCases(cases: *tests.StackTracesContext) void {
                 },
             );
         },
-        .macosx => {
+        .macos => {
             cases.addCase(
                 "return",
                 source_return,
test/tests.zig
@@ -234,7 +234,7 @@ const test_targets = blk: {
         TestTarget{
             .target = .{
                 .cpu_arch = .x86_64,
-                .os_tag = .macosx,
+                .os_tag = .macos,
                 .abi = .gnu,
             },
             // https://github.com/ziglang/zig/issues/3295