| author | |
| committer | |
| log | 2e1fc0dd14c2897cd6fb4ff433bff2e5297272cb |
| tree | 342325fd62cc47755cf1dddf7305365d298f6fe6 |
| parent | 8f202ba7c7c446da9dff4b9ca2bbfb5b21c0aa18 |
* rename .xros to .visionos as agreed in the tracking issue
* add support for VisionOS platform in the MachO linker25 files changed, 82 insertions(+), 68 deletions(-)
build.zig+1-1| ... | ... | @@ -705,7 +705,7 @@ fn addCmakeCfgOptionsToExe( |
| 705 | 705 | }; |
| 706 | 706 | exe.linkSystemLibrary("unwind"); |
| 707 | 707 | }, |
| 708 | .ios, .macos, .watchos, .tvos => { | |
| 708 | .ios, .macos, .watchos, .tvos, .visionos => { | |
| 709 | 709 | exe.linkLibCpp(); |
| 710 | 710 | }, |
| 711 | 711 | .windows => { |
lib/compiler/aro/aro/Compilation.zig+2-2| ... | ... | @@ -912,12 +912,12 @@ fn generateVaListType(comp: *Compilation) !Type { |
| 912 | 912 | const kind: Kind = switch (comp.target.cpu.arch) { |
| 913 | 913 | .aarch64 => switch (comp.target.os.tag) { |
| 914 | 914 | .windows => @as(Kind, .char_ptr), |
| 915 | .ios, .macos, .tvos, .watchos => .char_ptr, | |
| 915 | .ios, .macos, .tvos, .watchos, .visionos => .char_ptr, | |
| 916 | 916 | else => .aarch64_va_list, |
| 917 | 917 | }, |
| 918 | 918 | .sparc, .wasm32, .wasm64, .bpfel, .bpfeb, .riscv32, .riscv64, .avr, .spirv32, .spirv64 => .void_ptr, |
| 919 | 919 | .powerpc => switch (comp.target.os.tag) { |
| 920 | .ios, .macos, .tvos, .watchos, .aix => @as(Kind, .char_ptr), | |
| 920 | .ios, .macos, .tvos, .watchos, .visionos, .aix => @as(Kind, .char_ptr), | |
| 921 | 921 | else => return Type{ .specifier = .void }, // unknown |
| 922 | 922 | }, |
| 923 | 923 | .x86, .msp430 => .char_ptr, |
lib/compiler/aro/aro/target.zig+1| ... | ... | @@ -706,6 +706,7 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 { |
| 706 | 706 | .ios => "ios", |
| 707 | 707 | .tvos => "tvos", |
| 708 | 708 | .watchos => "watchos", |
| 709 | .visionos => "xros", | |
| 709 | 710 | .driverkit => "driverkit", |
| 710 | 711 | .shadermodel => "shadermodel", |
| 711 | 712 | .liteos => "liteos", |
lib/compiler_rt/clear_cache.zig+1-1| ... | ... | @@ -45,7 +45,7 @@ fn clear_cache(start: usize, end: usize) callconv(.C) void { |
| 45 | 45 | else => false, |
| 46 | 46 | }; |
| 47 | 47 | const apple = switch (os) { |
| 48 | .ios, .macos, .watchos, .tvos => true, | |
| 48 | .ios, .macos, .watchos, .tvos, .visionos => true, | |
| 49 | 49 | else => false, |
| 50 | 50 | }; |
| 51 | 51 | if (x86) { |
lib/std/Target.zig+18-12| ... | ... | @@ -47,7 +47,7 @@ pub const Os = struct { |
| 47 | 47 | tvos, |
| 48 | 48 | watchos, |
| 49 | 49 | driverkit, |
| 50 | xros, | |
| 50 | visionos, | |
| 51 | 51 | mesa3d, |
| 52 | 52 | contiki, |
| 53 | 53 | amdpal, |
| ... | ... | @@ -67,7 +67,7 @@ pub const Os = struct { |
| 67 | 67 | |
| 68 | 68 | pub inline fn isDarwin(tag: Tag) bool { |
| 69 | 69 | return switch (tag) { |
| 70 | .ios, .macos, .watchos, .tvos => true, | |
| 70 | .ios, .macos, .watchos, .tvos, .visionos => true, | |
| 71 | 71 | else => false, |
| 72 | 72 | }; |
| 73 | 73 | } |
| ... | ... | @@ -108,7 +108,7 @@ pub const Os = struct { |
| 108 | 108 | pub fn dynamicLibSuffix(tag: Tag) [:0]const u8 { |
| 109 | 109 | return switch (tag) { |
| 110 | 110 | .windows, .uefi => ".dll", |
| 111 | .ios, .macos, .watchos, .tvos => ".dylib", | |
| 111 | .ios, .macos, .watchos, .tvos, .visionos => ".dylib", | |
| 112 | 112 | else => ".so", |
| 113 | 113 | }; |
| 114 | 114 | } |
| ... | ... | @@ -178,7 +178,7 @@ pub const Os = struct { |
| 178 | 178 | .ios, |
| 179 | 179 | .tvos, |
| 180 | 180 | .watchos, |
| 181 | .xros, | |
| 181 | .visionos, | |
| 182 | 182 | .netbsd, |
| 183 | 183 | .openbsd, |
| 184 | 184 | .dragonfly, |
| ... | ... | @@ -434,7 +434,12 @@ pub const Os = struct { |
| 434 | 434 | .max = .{ .major = 17, .minor = 1, .patch = 0 }, |
| 435 | 435 | }, |
| 436 | 436 | }, |
| 437 | .xros => @panic("TODO what version is xros on right now?"), | |
| 437 | .visionos => .{ | |
| 438 | .semver = .{ | |
| 439 | .min = .{ .major = 1, .minor = 0, .patch = 0 }, | |
| 440 | .max = .{ .major = 1, .minor = 0, .patch = 0 }, | |
| 441 | }, | |
| 442 | }, | |
| 438 | 443 | .netbsd => .{ |
| 439 | 444 | .semver = .{ |
| 440 | 445 | .min = .{ .major = 8, .minor = 0, .patch = 0 }, |
| ... | ... | @@ -531,7 +536,7 @@ pub const Os = struct { |
| 531 | 536 | .ios, |
| 532 | 537 | .tvos, |
| 533 | 538 | .watchos, |
| 534 | .xros, | |
| 539 | .visionos, | |
| 535 | 540 | .dragonfly, |
| 536 | 541 | .openbsd, |
| 537 | 542 | .haiku, |
| ... | ... | @@ -691,7 +696,7 @@ pub const Abi = enum { |
| 691 | 696 | .ios, |
| 692 | 697 | .tvos, |
| 693 | 698 | .watchos, |
| 694 | .xros, | |
| 699 | .visionos, | |
| 695 | 700 | .driverkit, |
| 696 | 701 | .shadermodel, |
| 697 | 702 | .liteos, // TODO: audit this |
| ... | ... | @@ -768,7 +773,7 @@ pub const ObjectFormat = enum { |
| 768 | 773 | pub fn default(os_tag: Os.Tag, arch: Cpu.Arch) ObjectFormat { |
| 769 | 774 | return switch (os_tag) { |
| 770 | 775 | .windows, .uefi => .coff, |
| 771 | .ios, .macos, .watchos, .tvos => .macho, | |
| 776 | .ios, .macos, .watchos, .tvos, .visionos => .macho, | |
| 772 | 777 | .plan9 => .plan9, |
| 773 | 778 | else => switch (arch) { |
| 774 | 779 | .wasm32, .wasm64 => .wasm, |
| ... | ... | @@ -1633,6 +1638,7 @@ pub inline fn hasDynamicLinker(target: Target) bool { |
| 1633 | 1638 | .tvos, |
| 1634 | 1639 | .watchos, |
| 1635 | 1640 | .macos, |
| 1641 | .visionos, | |
| 1636 | 1642 | .uefi, |
| 1637 | 1643 | .windows, |
| 1638 | 1644 | .emscripten, |
| ... | ... | @@ -1807,7 +1813,7 @@ pub const DynamicLinker = struct { |
| 1807 | 1813 | .tvos, |
| 1808 | 1814 | .watchos, |
| 1809 | 1815 | .macos, |
| 1810 | .xros, | |
| 1816 | .visionos, | |
| 1811 | 1817 | => init("/usr/lib/dyld"), |
| 1812 | 1818 | |
| 1813 | 1819 | // Operating systems in this list have been verified as not having a standard |
| ... | ... | @@ -2287,7 +2293,7 @@ pub fn c_type_bit_size(target: Target, c_type: CType) u16 { |
| 2287 | 2293 | }, |
| 2288 | 2294 | }, |
| 2289 | 2295 | |
| 2290 | .macos, .ios, .tvos, .watchos, .xros => switch (c_type) { | |
| 2296 | .macos, .ios, .tvos, .watchos, .visionos => switch (c_type) { | |
| 2291 | 2297 | .char => return 8, |
| 2292 | 2298 | .short, .ushort => return 16, |
| 2293 | 2299 | .int, .uint, .float => return 32, |
| ... | ... | @@ -2407,7 +2413,7 @@ pub fn c_type_alignment(target: Target, c_type: CType) u16 { |
| 2407 | 2413 | |
| 2408 | 2414 | else => 4, |
| 2409 | 2415 | }, |
| 2410 | .ios, .tvos, .watchos => 4, | |
| 2416 | .ios, .tvos, .watchos, .visionos => 4, | |
| 2411 | 2417 | else => 8, |
| 2412 | 2418 | }, |
| 2413 | 2419 | |
| ... | ... | @@ -2500,7 +2506,7 @@ pub fn c_type_preferred_alignment(target: Target, c_type: CType) u16 { |
| 2500 | 2506 | else => {}, |
| 2501 | 2507 | }, |
| 2502 | 2508 | }, |
| 2503 | .ios, .tvos, .watchos => switch (c_type) { | |
| 2509 | .ios, .tvos, .watchos, .visionos => switch (c_type) { | |
| 2504 | 2510 | .longdouble => return 4, |
| 2505 | 2511 | else => {}, |
| 2506 | 2512 | }, |
lib/std/Thread.zig+6-6| ... | ... | @@ -39,7 +39,7 @@ impl: Impl, |
| 39 | 39 | pub const max_name_len = switch (native_os) { |
| 40 | 40 | .linux => 15, |
| 41 | 41 | .windows => 31, |
| 42 | .macos, .ios, .watchos, .tvos => 63, | |
| 42 | .macos, .ios, .watchos, .tvos, .visionos => 63, | |
| 43 | 43 | .netbsd => 31, |
| 44 | 44 | .freebsd => 15, |
| 45 | 45 | .openbsd => 23, |
| ... | ... | @@ -114,7 +114,7 @@ pub fn setName(self: Thread, name: []const u8) SetNameError!void { |
| 114 | 114 | else => |err| return windows.unexpectedStatus(err), |
| 115 | 115 | } |
| 116 | 116 | }, |
| 117 | .macos, .ios, .watchos, .tvos => if (use_pthreads) { | |
| 117 | .macos, .ios, .watchos, .tvos, .visionos => if (use_pthreads) { | |
| 118 | 118 | // There doesn't seem to be a way to set the name for an arbitrary thread, only the current one. |
| 119 | 119 | if (self.getHandle() != std.c.pthread_self()) return error.Unsupported; |
| 120 | 120 | |
| ... | ... | @@ -217,7 +217,7 @@ pub fn getName(self: Thread, buffer_ptr: *[max_name_len:0]u8) GetNameError!?[]co |
| 217 | 217 | else => |err| return windows.unexpectedStatus(err), |
| 218 | 218 | } |
| 219 | 219 | }, |
| 220 | .macos, .ios, .watchos, .tvos => if (use_pthreads) { | |
| 220 | .macos, .ios, .watchos, .tvos, .visionos => if (use_pthreads) { | |
| 221 | 221 | const err = std.c.pthread_getname_np(self.getHandle(), buffer.ptr, max_name_len + 1); |
| 222 | 222 | switch (err) { |
| 223 | 223 | .SUCCESS => return std.mem.sliceTo(buffer, 0), |
| ... | ... | @@ -266,7 +266,7 @@ pub const Id = switch (native_os) { |
| 266 | 266 | .haiku, |
| 267 | 267 | .wasi, |
| 268 | 268 | => u32, |
| 269 | .macos, .ios, .watchos, .tvos => u64, | |
| 269 | .macos, .ios, .watchos, .tvos, .visionos => u64, | |
| 270 | 270 | .windows => windows.DWORD, |
| 271 | 271 | else => usize, |
| 272 | 272 | }; |
| ... | ... | @@ -588,7 +588,7 @@ const PosixThreadImpl = struct { |
| 588 | 588 | .linux => { |
| 589 | 589 | return LinuxThreadImpl.getCurrentId(); |
| 590 | 590 | }, |
| 591 | .macos, .ios, .watchos, .tvos => { | |
| 591 | .macos, .ios, .watchos, .tvos, .visionos => { | |
| 592 | 592 | var thread_id: u64 = undefined; |
| 593 | 593 | // Pass thread=null to get the current thread ID. |
| 594 | 594 | assert(c.pthread_threadid_np(null, &thread_id) == 0); |
| ... | ... | @@ -1434,7 +1434,7 @@ test "setName, getName" { |
| 1434 | 1434 | context.test_done_event.wait(); |
| 1435 | 1435 | |
| 1436 | 1436 | switch (native_os) { |
| 1437 | .macos, .ios, .watchos, .tvos => { | |
| 1437 | .macos, .ios, .watchos, .tvos, .visionos => { | |
| 1438 | 1438 | const res = thread.setName("foobar"); |
| 1439 | 1439 | try std.testing.expectError(error.Unsupported, res); |
| 1440 | 1440 | }, |
lib/std/builtin.zig+3-3| ... | ... | @@ -597,11 +597,11 @@ pub const VaListX86_64 = extern struct { |
| 597 | 597 | pub const VaList = switch (builtin.cpu.arch) { |
| 598 | 598 | .aarch64, .aarch64_be => switch (builtin.os.tag) { |
| 599 | 599 | .windows => *u8, |
| 600 | .ios, .macos, .tvos, .watchos => *u8, | |
| 600 | .ios, .macos, .tvos, .watchos, .visionos => *u8, | |
| 601 | 601 | else => @compileError("disabled due to miscompilations"), // VaListAarch64, |
| 602 | 602 | }, |
| 603 | 603 | .arm => switch (builtin.os.tag) { |
| 604 | .ios, .macos, .tvos, .watchos => *u8, | |
| 604 | .ios, .macos, .tvos, .watchos, .visionos => *u8, | |
| 605 | 605 | else => *anyopaque, |
| 606 | 606 | }, |
| 607 | 607 | .amdgcn => *u8, |
| ... | ... | @@ -611,7 +611,7 @@ pub const VaList = switch (builtin.cpu.arch) { |
| 611 | 611 | .mips, .mipsel, .mips64, .mips64el => *anyopaque, |
| 612 | 612 | .riscv32, .riscv64 => *anyopaque, |
| 613 | 613 | .powerpc, .powerpcle => switch (builtin.os.tag) { |
| 614 | .ios, .macos, .tvos, .watchos, .aix => *u8, | |
| 614 | .ios, .macos, .tvos, .watchos, .visionos, .aix => *u8, | |
| 615 | 615 | else => VaListPowerPc, |
| 616 | 616 | }, |
| 617 | 617 | .powerpc64, .powerpc64le => *u8, |
lib/std/c.zig+17-17| ... | ... | @@ -35,7 +35,7 @@ pub inline fn versionCheck(comptime glibc_version: std.SemanticVersion) bool { |
| 35 | 35 | pub usingnamespace switch (native_os) { |
| 36 | 36 | .linux => @import("c/linux.zig"), |
| 37 | 37 | .windows => @import("c/windows.zig"), |
| 38 | .macos, .ios, .tvos, .watchos => @import("c/darwin.zig"), | |
| 38 | .macos, .ios, .tvos, .watchos, .visionos => @import("c/darwin.zig"), | |
| 39 | 39 | .freebsd, .kfreebsd => @import("c/freebsd.zig"), |
| 40 | 40 | .netbsd => @import("c/netbsd.zig"), |
| 41 | 41 | .dragonfly => @import("c/dragonfly.zig"), |
| ... | ... | @@ -63,7 +63,7 @@ pub const pthread_mutex_t = switch (native_os) { |
| 63 | 63 | else => @compileError("unsupported ABI"), |
| 64 | 64 | }; |
| 65 | 65 | }, |
| 66 | .macos, .ios, .tvos, .watchos => extern struct { | |
| 66 | .macos, .ios, .tvos, .watchos, .visionos => extern struct { | |
| 67 | 67 | sig: c_long = 0x32AAABA7, |
| 68 | 68 | data: [data_len]u8 = [_]u8{0} ** data_len, |
| 69 | 69 | |
| ... | ... | @@ -113,7 +113,7 @@ pub const pthread_cond_t = switch (native_os) { |
| 113 | 113 | .linux => extern struct { |
| 114 | 114 | data: [48]u8 align(@alignOf(usize)) = [_]u8{0} ** 48, |
| 115 | 115 | }, |
| 116 | .macos, .ios, .tvos, .watchos => extern struct { | |
| 116 | .macos, .ios, .tvos, .watchos, .visionos => extern struct { | |
| 117 | 117 | sig: c_long = 0x3CB0B1BB, |
| 118 | 118 | data: [data_len]u8 = [_]u8{0} ** data_len, |
| 119 | 119 | const data_len = if (@sizeOf(usize) == 8) 40 else 24; |
| ... | ... | @@ -166,7 +166,7 @@ pub const pthread_rwlock_t = switch (native_os) { |
| 166 | 166 | data: [56]u8 align(@alignOf(usize)) = [_]u8{0} ** 56, |
| 167 | 167 | }, |
| 168 | 168 | }, |
| 169 | .macos, .ios, .tvos, .watchos => extern struct { | |
| 169 | .macos, .ios, .tvos, .watchos, .visionos => extern struct { | |
| 170 | 170 | sig: c_long = 0x2DA8B3B4, |
| 171 | 171 | data: [192]u8 = [_]u8{0} ** 192, |
| 172 | 172 | }, |
| ... | ... | @@ -214,7 +214,7 @@ pub const AT = switch (native_os) { |
| 214 | 214 | /// Remove directory instead of unlinking file |
| 215 | 215 | pub const REMOVEDIR = 0x200; |
| 216 | 216 | }, |
| 217 | .macos, .ios, .tvos, .watchos => struct { | |
| 217 | .macos, .ios, .tvos, .watchos, .visionos => struct { | |
| 218 | 218 | pub const FDCWD = -2; |
| 219 | 219 | /// Use effective ids in access check |
| 220 | 220 | pub const EACCESS = 0x0010; |
| ... | ... | @@ -458,7 +458,7 @@ pub const O = switch (native_os) { |
| 458 | 458 | DIRECTORY: bool = false, |
| 459 | 459 | _: u10 = 0, |
| 460 | 460 | }, |
| 461 | .macos, .ios, .tvos, .watchos => packed struct(u32) { | |
| 461 | .macos, .ios, .tvos, .watchos, .visionos => packed struct(u32) { | |
| 462 | 462 | ACCMODE: std.posix.ACCMODE = .RDONLY, |
| 463 | 463 | NONBLOCK: bool = false, |
| 464 | 464 | APPEND: bool = false, |
| ... | ... | @@ -620,7 +620,7 @@ pub const MAP = switch (native_os) { |
| 620 | 620 | NORESERVE: bool = false, |
| 621 | 621 | _: u27 = 0, |
| 622 | 622 | }, |
| 623 | .macos, .ios, .tvos, .watchos => packed struct(u32) { | |
| 623 | .macos, .ios, .tvos, .watchos, .visionos => packed struct(u32) { | |
| 624 | 624 | TYPE: enum(u4) { |
| 625 | 625 | SHARED = 0x01, |
| 626 | 626 | PRIVATE = 0x02, |
| ... | ... | @@ -685,7 +685,7 @@ pub const cc_t = u8; |
| 685 | 685 | /// Indices into the `cc` array in the `termios` struct. |
| 686 | 686 | pub const V = switch (native_os) { |
| 687 | 687 | .linux => linux.V, |
| 688 | .macos, .ios, .tvos, .watchos, .netbsd, .openbsd => enum { | |
| 688 | .macos, .ios, .tvos, .watchos, .visionos, .netbsd, .openbsd => enum { | |
| 689 | 689 | EOF, |
| 690 | 690 | EOL, |
| 691 | 691 | EOL2, |
| ... | ... | @@ -784,7 +784,7 @@ pub const V = switch (native_os) { |
| 784 | 784 | |
| 785 | 785 | pub const NCCS = switch (native_os) { |
| 786 | 786 | .linux => linux.NCCS, |
| 787 | .macos, .ios, .tvos, .watchos, .freebsd, .kfreebsd, .netbsd, .openbsd, .dragonfly => 20, | |
| 787 | .macos, .ios, .tvos, .watchos, .visionos, .freebsd, .kfreebsd, .netbsd, .openbsd, .dragonfly => 20, | |
| 788 | 788 | .haiku => 11, |
| 789 | 789 | .solaris, .illumos => 19, |
| 790 | 790 | .emscripten, .wasi => 32, |
| ... | ... | @@ -793,7 +793,7 @@ pub const NCCS = switch (native_os) { |
| 793 | 793 | |
| 794 | 794 | pub const termios = switch (native_os) { |
| 795 | 795 | .linux => linux.termios, |
| 796 | .macos, .ios, .tvos, .watchos => extern struct { | |
| 796 | .macos, .ios, .tvos, .watchos, .visionos => extern struct { | |
| 797 | 797 | iflag: tc_iflag_t, |
| 798 | 798 | oflag: tc_oflag_t, |
| 799 | 799 | cflag: tc_cflag_t, |
| ... | ... | @@ -843,7 +843,7 @@ pub const termios = switch (native_os) { |
| 843 | 843 | |
| 844 | 844 | pub const tc_iflag_t = switch (native_os) { |
| 845 | 845 | .linux => linux.tc_iflag_t, |
| 846 | .macos, .ios, .tvos, .watchos => packed struct(u64) { | |
| 846 | .macos, .ios, .tvos, .watchos, .visionos => packed struct(u64) { | |
| 847 | 847 | IGNBRK: bool = false, |
| 848 | 848 | BRKINT: bool = false, |
| 849 | 849 | IGNPAR: bool = false, |
| ... | ... | @@ -953,7 +953,7 @@ pub const tc_iflag_t = switch (native_os) { |
| 953 | 953 | |
| 954 | 954 | pub const tc_oflag_t = switch (native_os) { |
| 955 | 955 | .linux => linux.tc_oflag_t, |
| 956 | .macos, .ios, .tvos, .watchos => packed struct(u64) { | |
| 956 | .macos, .ios, .tvos, .watchos, .visionos => packed struct(u64) { | |
| 957 | 957 | OPOST: bool = false, |
| 958 | 958 | ONLCR: bool = false, |
| 959 | 959 | OXTABS: bool = false, |
| ... | ... | @@ -1050,7 +1050,7 @@ pub const CSIZE = switch (native_os) { |
| 1050 | 1050 | |
| 1051 | 1051 | pub const tc_cflag_t = switch (native_os) { |
| 1052 | 1052 | .linux => linux.tc_cflag_t, |
| 1053 | .macos, .ios, .tvos, .watchos => packed struct(u64) { | |
| 1053 | .macos, .ios, .tvos, .watchos, .visionos => packed struct(u64) { | |
| 1054 | 1054 | CIGNORE: bool = false, |
| 1055 | 1055 | _1: u5 = 0, |
| 1056 | 1056 | CSTOPB: bool = false, |
| ... | ... | @@ -1186,7 +1186,7 @@ pub const tc_cflag_t = switch (native_os) { |
| 1186 | 1186 | |
| 1187 | 1187 | pub const tc_lflag_t = switch (native_os) { |
| 1188 | 1188 | .linux => linux.tc_lflag_t, |
| 1189 | .macos, .ios, .tvos, .watchos => packed struct(u64) { | |
| 1189 | .macos, .ios, .tvos, .watchos, .visionos => packed struct(u64) { | |
| 1190 | 1190 | ECHOKE: bool = false, |
| 1191 | 1191 | ECHOE: bool = false, |
| 1192 | 1192 | ECHOK: bool = false, |
| ... | ... | @@ -1312,7 +1312,7 @@ pub const tc_lflag_t = switch (native_os) { |
| 1312 | 1312 | |
| 1313 | 1313 | pub const speed_t = switch (native_os) { |
| 1314 | 1314 | .linux => linux.speed_t, |
| 1315 | .macos, .ios, .tvos, .watchos, .openbsd => enum(u64) { | |
| 1315 | .macos, .ios, .tvos, .watchos, .visionos, .openbsd => enum(u64) { | |
| 1316 | 1316 | B0 = 0, |
| 1317 | 1317 | B50 = 50, |
| 1318 | 1318 | B75 = 75, |
| ... | ... | @@ -1535,7 +1535,7 @@ pub const fstatat = switch (native_os) { |
| 1535 | 1535 | }; |
| 1536 | 1536 | |
| 1537 | 1537 | pub const getdirentries = switch (native_os) { |
| 1538 | .macos, .ios, .tvos, .watchos => private.__getdirentries64, | |
| 1538 | .macos, .ios, .tvos, .watchos, .visionos => private.__getdirentries64, | |
| 1539 | 1539 | else => private.getdirentries, |
| 1540 | 1540 | }; |
| 1541 | 1541 | |
| ... | ... | @@ -1569,7 +1569,7 @@ pub const readdir = switch (native_os) { |
| 1569 | 1569 | }; |
| 1570 | 1570 | |
| 1571 | 1571 | pub const realpath = switch (native_os) { |
| 1572 | .macos, .ios, .tvos, .watchos => private.@"realpath$DARWIN_EXTSN", | |
| 1572 | .macos, .ios, .tvos, .watchos, .visionos => private.@"realpath$DARWIN_EXTSN", | |
| 1573 | 1573 | else => private.realpath, |
| 1574 | 1574 | }; |
| 1575 | 1575 |
lib/std/crypto/tlcsprng.zig+1| ... | ... | @@ -29,6 +29,7 @@ const os_has_fork = switch (native_os) { |
| 29 | 29 | .illumos, |
| 30 | 30 | .tvos, |
| 31 | 31 | .watchos, |
| 32 | .visionos, | |
| 32 | 33 | .haiku, |
| 33 | 34 | => true, |
| 34 | 35 |
lib/std/debug.zig+2-2| ... | ... | @@ -706,7 +706,7 @@ pub const StackIterator = struct { |
| 706 | 706 | const unwind_state = &self.unwind_state.?; |
| 707 | 707 | const module = try unwind_state.debug_info.getModuleForAddress(unwind_state.dwarf_context.pc); |
| 708 | 708 | switch (native_os) { |
| 709 | .macos, .ios, .watchos, .tvos => { | |
| 709 | .macos, .ios, .watchos, .tvos, .visionos => { | |
| 710 | 710 | // __unwind_info is a requirement for unwinding on Darwin. It may fall back to DWARF, but unwinding |
| 711 | 711 | // via DWARF before attempting to use the compact unwind info will produce incorrect results. |
| 712 | 712 | if (module.unwind_info) |unwind_info| { |
| ... | ... | @@ -2132,7 +2132,7 @@ pub const DebugInfo = struct { |
| 2132 | 2132 | }; |
| 2133 | 2133 | |
| 2134 | 2134 | pub const ModuleDebugInfo = switch (native_os) { |
| 2135 | .macos, .ios, .watchos, .tvos => struct { | |
| 2135 | .macos, .ios, .watchos, .tvos, .visionos => struct { | |
| 2136 | 2136 | base_address: usize, |
| 2137 | 2137 | vmaddr_slide: usize, |
| 2138 | 2138 | mapped_memory: []align(mem.page_size) const u8, |
lib/std/dynamic_library.zig+2-2| ... | ... | @@ -16,7 +16,7 @@ pub const DynLib = struct { |
| 16 | 16 | else |
| 17 | 17 | DlDynLib, |
| 18 | 18 | .windows => WindowsDynLib, |
| 19 | .macos, .tvos, .watchos, .ios, .freebsd, .netbsd, .openbsd, .dragonfly, .solaris, .illumos => DlDynLib, | |
| 19 | .macos, .tvos, .watchos, .ios, .visionos, .freebsd, .netbsd, .openbsd, .dragonfly, .solaris, .illumos => DlDynLib, | |
| 20 | 20 | else => @compileError("unsupported platform"), |
| 21 | 21 | }; |
| 22 | 22 | |
| ... | ... | @@ -461,7 +461,7 @@ test "dynamic_library" { |
| 461 | 461 | const libname = switch (native_os) { |
| 462 | 462 | .linux, .freebsd, .openbsd, .solaris, .illumos => "invalid_so.so", |
| 463 | 463 | .windows => "invalid_dll.dll", |
| 464 | .macos, .tvos, .watchos, .ios => "invalid_dylib.dylib", | |
| 464 | .macos, .tvos, .watchos, .ios, .visionos => "invalid_dylib.dylib", | |
| 465 | 465 | else => return error.SkipZigTest, |
| 466 | 466 | }; |
| 467 | 467 |
lib/std/mem.zig+1-1| ... | ... | @@ -13,7 +13,7 @@ const native_endian = builtin.cpu.arch.endian(); |
| 13 | 13 | pub const page_size = switch (builtin.cpu.arch) { |
| 14 | 14 | .wasm32, .wasm64 => 64 * 1024, |
| 15 | 15 | .aarch64 => switch (builtin.os.tag) { |
| 16 | .macos, .ios, .watchos, .tvos => 16 * 1024, | |
| 16 | .macos, .ios, .watchos, .tvos, .visionos => 16 * 1024, | |
| 17 | 17 | else => 4 * 1024, |
| 18 | 18 | }, |
| 19 | 19 | .sparc64 => 8 * 1024, |
lib/std/os.zig+2-1| ... | ... | @@ -76,6 +76,7 @@ pub fn isGetFdPathSupportedOnTarget(os: std.Target.Os) bool { |
| 76 | 76 | .ios, |
| 77 | 77 | .watchos, |
| 78 | 78 | .tvos, |
| 79 | .visionos, | |
| 79 | 80 | .linux, |
| 80 | 81 | .solaris, |
| 81 | 82 | .illumos, |
| ... | ... | @@ -110,7 +111,7 @@ pub fn getFdPath(fd: std.posix.fd_t, out_buffer: *[MAX_PATH_BYTES]u8) std.posix. |
| 110 | 111 | const end_index = std.unicode.wtf16LeToWtf8(out_buffer, wide_slice); |
| 111 | 112 | return out_buffer[0..end_index]; |
| 112 | 113 | }, |
| 113 | .macos, .ios, .watchos, .tvos => { | |
| 114 | .macos, .ios, .watchos, .tvos, .visionos => { | |
| 114 | 115 | // On macOS, we can use F.GETPATH fcntl command to query the OS for |
| 115 | 116 | // the path to the file descriptor. |
| 116 | 117 | @memset(out_buffer[0..MAX_PATH_BYTES], 0); |
lib/std/posix.zig+11-11| ... | ... | @@ -604,7 +604,7 @@ pub fn getrandom(buffer: []u8) GetRandomError!void { |
| 604 | 604 | } |
| 605 | 605 | } |
| 606 | 606 | switch (native_os) { |
| 607 | .netbsd, .openbsd, .macos, .ios, .tvos, .watchos => { | |
| 607 | .netbsd, .openbsd, .macos, .ios, .tvos, .watchos, .visionos => { | |
| 608 | 608 | system.arc4random_buf(buffer.ptr, buffer.len); |
| 609 | 609 | return; |
| 610 | 610 | }, |
| ... | ... | @@ -823,7 +823,7 @@ pub fn read(fd: fd_t, buf: []u8) ReadError!usize { |
| 823 | 823 | // Prevents EINVAL. |
| 824 | 824 | const max_count = switch (native_os) { |
| 825 | 825 | .linux => 0x7ffff000, |
| 826 | .macos, .ios, .watchos, .tvos => maxInt(i32), | |
| 826 | .macos, .ios, .watchos, .tvos, .visionos => maxInt(i32), | |
| 827 | 827 | else => maxInt(isize), |
| 828 | 828 | }; |
| 829 | 829 | while (true) { |
| ... | ... | @@ -962,7 +962,7 @@ pub fn pread(fd: fd_t, buf: []u8, offset: u64) PReadError!usize { |
| 962 | 962 | // Prevent EINVAL. |
| 963 | 963 | const max_count = switch (native_os) { |
| 964 | 964 | .linux => 0x7ffff000, |
| 965 | .macos, .ios, .watchos, .tvos => maxInt(i32), | |
| 965 | .macos, .ios, .watchos, .tvos, .visionos => maxInt(i32), | |
| 966 | 966 | else => maxInt(isize), |
| 967 | 967 | }; |
| 968 | 968 | |
| ... | ... | @@ -1069,7 +1069,7 @@ pub fn ftruncate(fd: fd_t, length: u64) TruncateError!void { |
| 1069 | 1069 | /// On these systems, the read races with concurrent writes to the same file descriptor. |
| 1070 | 1070 | pub fn preadv(fd: fd_t, iov: []const iovec, offset: u64) PReadError!usize { |
| 1071 | 1071 | const have_pread_but_not_preadv = switch (native_os) { |
| 1072 | .windows, .macos, .ios, .watchos, .tvos, .haiku => true, | |
| 1072 | .windows, .macos, .ios, .watchos, .tvos, .visionos, .haiku => true, | |
| 1073 | 1073 | else => false, |
| 1074 | 1074 | }; |
| 1075 | 1075 | if (have_pread_but_not_preadv) { |
| ... | ... | @@ -1211,7 +1211,7 @@ pub fn write(fd: fd_t, bytes: []const u8) WriteError!usize { |
| 1211 | 1211 | |
| 1212 | 1212 | const max_count = switch (native_os) { |
| 1213 | 1213 | .linux => 0x7ffff000, |
| 1214 | .macos, .ios, .watchos, .tvos => maxInt(i32), | |
| 1214 | .macos, .ios, .watchos, .tvos, .visionos => maxInt(i32), | |
| 1215 | 1215 | else => maxInt(isize), |
| 1216 | 1216 | }; |
| 1217 | 1217 | while (true) { |
| ... | ... | @@ -1370,7 +1370,7 @@ pub fn pwrite(fd: fd_t, bytes: []const u8, offset: u64) PWriteError!usize { |
| 1370 | 1370 | // Prevent EINVAL. |
| 1371 | 1371 | const max_count = switch (native_os) { |
| 1372 | 1372 | .linux => 0x7ffff000, |
| 1373 | .macos, .ios, .watchos, .tvos => maxInt(i32), | |
| 1373 | .macos, .ios, .watchos, .tvos, .visionos => maxInt(i32), | |
| 1374 | 1374 | else => maxInt(isize), |
| 1375 | 1375 | }; |
| 1376 | 1376 | |
| ... | ... | @@ -1423,7 +1423,7 @@ pub fn pwrite(fd: fd_t, bytes: []const u8, offset: u64) PWriteError!usize { |
| 1423 | 1423 | /// If `iov.len` is larger than `IOV_MAX`, a partial write will occur. |
| 1424 | 1424 | pub fn pwritev(fd: fd_t, iov: []const iovec_const, offset: u64) PWriteError!usize { |
| 1425 | 1425 | const have_pwrite_but_not_pwritev = switch (native_os) { |
| 1426 | .windows, .macos, .ios, .watchos, .tvos, .haiku => true, | |
| 1426 | .windows, .macos, .ios, .watchos, .tvos, .visionos, .haiku => true, | |
| 1427 | 1427 | else => false, |
| 1428 | 1428 | }; |
| 1429 | 1429 | |
| ... | ... | @@ -1846,7 +1846,7 @@ pub fn execveZ( |
| 1846 | 1846 | .NOTDIR => return error.NotDir, |
| 1847 | 1847 | .TXTBSY => return error.FileBusy, |
| 1848 | 1848 | else => |err| switch (native_os) { |
| 1849 | .macos, .ios, .tvos, .watchos => switch (err) { | |
| 1849 | .macos, .ios, .tvos, .watchos, .visionos => switch (err) { | |
| 1850 | 1850 | .BADEXEC => return error.InvalidExe, |
| 1851 | 1851 | .BADARCH => return error.InvalidExe, |
| 1852 | 1852 | else => return unexpectedErrno(err), |
| ... | ... | @@ -6123,7 +6123,7 @@ pub fn sendfile( |
| 6123 | 6123 | const size_t = std.meta.Int(.unsigned, @typeInfo(usize).Int.bits - 1); |
| 6124 | 6124 | const max_count = switch (native_os) { |
| 6125 | 6125 | .linux => 0x7ffff000, |
| 6126 | .macos, .ios, .watchos, .tvos => maxInt(i32), | |
| 6126 | .macos, .ios, .watchos, .tvos, .visionos => maxInt(i32), | |
| 6127 | 6127 | else => maxInt(size_t), |
| 6128 | 6128 | }; |
| 6129 | 6129 | |
| ... | ... | @@ -6268,7 +6268,7 @@ pub fn sendfile( |
| 6268 | 6268 | } |
| 6269 | 6269 | } |
| 6270 | 6270 | }, |
| 6271 | .macos, .ios, .tvos, .watchos => sf: { | |
| 6271 | .macos, .ios, .tvos, .watchos, .visionos => sf: { | |
| 6272 | 6272 | var hdtr_data: std.c.sf_hdtr = undefined; |
| 6273 | 6273 | var hdtr: ?*std.c.sf_hdtr = null; |
| 6274 | 6274 | if (headers.len != 0 or trailers.len != 0) { |
| ... | ... | @@ -7244,7 +7244,7 @@ pub fn ptrace(request: u32, pid: pid_t, addr: usize, signal: usize) PtraceError! |
| 7244 | 7244 | else => |err| return unexpectedErrno(err), |
| 7245 | 7245 | }, |
| 7246 | 7246 | |
| 7247 | .macos, .ios, .tvos, .watchos => switch (errno(std.c.ptrace( | |
| 7247 | .macos, .ios, .tvos, .watchos, .visionos => switch (errno(std.c.ptrace( | |
| 7248 | 7248 | @intCast(request), |
| 7249 | 7249 | pid, |
| 7250 | 7250 | @ptrFromInt(addr), |
lib/std/process.zig+2-1| ... | ... | @@ -1456,6 +1456,7 @@ pub fn getUserInfo(name: []const u8) !UserInfo { |
| 1456 | 1456 | .linux, |
| 1457 | 1457 | .macos, |
| 1458 | 1458 | .watchos, |
| 1459 | .visionos, | |
| 1459 | 1460 | .tvos, |
| 1460 | 1461 | .ios, |
| 1461 | 1462 | .freebsd, |
| ... | ... | @@ -1599,7 +1600,7 @@ pub const can_execv = switch (native_os) { |
| 1599 | 1600 | |
| 1600 | 1601 | /// Tells whether spawning child processes is supported (e.g. via ChildProcess) |
| 1601 | 1602 | pub const can_spawn = switch (native_os) { |
| 1602 | .wasi, .watchos, .tvos => false, | |
| 1603 | .wasi, .watchos, .tvos, .visionos => false, | |
| 1603 | 1604 | else => true, |
| 1604 | 1605 | }; |
| 1605 | 1606 |
lib/std/start.zig+1| ... | ... | @@ -576,6 +576,7 @@ fn maybeIgnoreSigpipe() void { |
| 576 | 576 | .ios, |
| 577 | 577 | .watchos, |
| 578 | 578 | .tvos, |
| 579 | .visionos, | |
| 579 | 580 | .dragonfly, |
| 580 | 581 | .freebsd, |
| 581 | 582 | => true, |
lib/std/time.zig+1-1| ... | ... | @@ -205,7 +205,7 @@ pub const Instant = struct { |
| 205 | 205 | }, |
| 206 | 206 | // On darwin, use UPTIME_RAW instead of MONOTONIC as it ticks while |
| 207 | 207 | // suspended. |
| 208 | .macos, .ios, .tvos, .watchos => posix.CLOCK.UPTIME_RAW, | |
| 208 | .macos, .ios, .tvos, .watchos, .visionos => posix.CLOCK.UPTIME_RAW, | |
| 209 | 209 | // On freebsd derivatives, use MONOTONIC_FAST as currently there's |
| 210 | 210 | // no precision tradeoff. |
| 211 | 211 | .freebsd, .dragonfly => posix.CLOCK.MONOTONIC_FAST, |
lib/std/zig/LibCDirs.zig+1-1| ... | ... | @@ -222,7 +222,7 @@ pub fn detectFromBuilding( |
| 222 | 222 | fn libCGenericName(target: std.Target) [:0]const u8 { |
| 223 | 223 | switch (target.os.tag) { |
| 224 | 224 | .windows => return "mingw", |
| 225 | .macos, .ios, .tvos, .watchos => return "darwin", | |
| 225 | .macos, .ios, .tvos, .watchos, .visionos => return "darwin", | |
| 226 | 226 | else => {}, |
| 227 | 227 | } |
| 228 | 228 | switch (target.abi) { |
lib/std/zig/system/darwin.zig+1| ... | ... | @@ -45,6 +45,7 @@ pub fn getSdk(allocator: Allocator, target: Target) ?[]const u8 { |
| 45 | 45 | }, |
| 46 | 46 | .watchos => if (is_simulator_abi) "watchsimulator" else "watchos", |
| 47 | 47 | .tvos => if (is_simulator_abi) "appletvsimulator" else "appletvos", |
| 48 | .visionos => if (is_simulator_abi) "xrsimulator" else "xros", | |
| 48 | 49 | else => return null, |
| 49 | 50 | }; |
| 50 | 51 | const argv = &[_][]const u8{ "/usr/bin/xcrun", "--sdk", sdk, "--show-sdk-path" }; |
src/Compilation.zig+1-1| ... | ... | @@ -5280,7 +5280,7 @@ pub fn addCCArgs( |
| 5280 | 5280 | // doesn't matter which one gets overridden. |
| 5281 | 5281 | argv.appendAssumeCapacity("-Wno-overriding-option"); |
| 5282 | 5282 | }, |
| 5283 | .ios, .tvos, .watchos => switch (target.cpu.arch) { | |
| 5283 | .ios => switch (target.cpu.arch) { | |
| 5284 | 5284 | // Pass the proper -m<os>-version-min argument for darwin. |
| 5285 | 5285 | .x86, .x86_64 => { |
| 5286 | 5286 | const ver = target.os.version_range.semver.min; |
src/codegen/llvm.zig+2-2| ... | ... | @@ -145,7 +145,7 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 { |
| 145 | 145 | .driverkit => "driverkit", |
| 146 | 146 | .shadermodel => "shadermodel", |
| 147 | 147 | .liteos => "liteos", |
| 148 | .xros => "xros", | |
| 148 | .visionos => "xros", | |
| 149 | 149 | .serenity => "serenity", |
| 150 | 150 | .vulkan => "vulkan", |
| 151 | 151 | |
| ... | ... | @@ -256,7 +256,7 @@ pub fn targetOs(os_tag: std.Target.Os.Tag) llvm.OSType { |
| 256 | 256 | .elfiamcu => .ELFIAMCU, |
| 257 | 257 | .tvos => .TvOS, |
| 258 | 258 | .watchos => .WatchOS, |
| 259 | .xros => .XROS, | |
| 259 | .visionos => .XROS, | |
| 260 | 260 | .mesa3d => .Mesa3D, |
| 261 | 261 | .amdpal => .AMDPAL, |
| 262 | 262 | .hermit => .HermitCore, |
src/libtsan.zig+1-1| ... | ... | @@ -125,7 +125,7 @@ pub fn buildTsan(comp: *Compilation, prog_node: *std.Progress.Node) BuildError!v |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | const platform_tsan_sources = switch (target.os.tag) { |
| 128 | .ios, .macos, .watchos, .tvos => &darwin_tsan_sources, | |
| 128 | .ios, .macos, .watchos, .tvos, .visionos => &darwin_tsan_sources, | |
| 129 | 129 | .windows => &windows_tsan_sources, |
| 130 | 130 | else => &unix_tsan_sources, |
| 131 | 131 | }; |
src/link/MachO.zig+2-1| ... | ... | @@ -3676,7 +3676,8 @@ pub inline fn getPageSize(self: MachO) u16 { |
| 3676 | 3676 | |
| 3677 | 3677 | pub fn requiresCodeSig(self: MachO) bool { |
| 3678 | 3678 | if (self.entitlements) |_| return true; |
| 3679 | if (self.options.adhoc_codesign) |cs| return cs; | |
| 3679 | // TODO: enable once we support this linker option | |
| 3680 | // if (self.options.adhoc_codesign) |cs| return cs; | |
| 3680 | 3681 | const target = self.getTarget(); |
| 3681 | 3682 | return switch (target.cpu.arch) { |
| 3682 | 3683 | .aarch64 => switch (target.os.tag) { |
src/main.zig+1-1| ... | ... | @@ -4432,7 +4432,7 @@ fn runOrTestHotSwap( |
| 4432 | 4432 | } |
| 4433 | 4433 | |
| 4434 | 4434 | switch (builtin.target.os.tag) { |
| 4435 | .macos, .ios, .tvos, .watchos => { | |
| 4435 | .macos, .ios, .tvos, .watchos, .visionos => { | |
| 4436 | 4436 | const PosixSpawn = @import("DarwinPosixSpawn.zig"); |
| 4437 | 4437 | |
| 4438 | 4438 | var attr = try PosixSpawn.Attr.init(); |
src/target.zig+1| ... | ... | @@ -26,6 +26,7 @@ pub fn libcNeedsLibUnwind(target: std.Target) bool { |
| 26 | 26 | .ios, |
| 27 | 27 | .watchos, |
| 28 | 28 | .tvos, |
| 29 | .visionos, | |
| 29 | 30 | .freestanding, |
| 30 | 31 | .wasi, // Wasm/WASI currently doesn't offer support for libunwind, so don't link it. |
| 31 | 32 | => false, |