diff --git a/lib/std/target.zig b/lib/std/target.zig index 0a87d442d8..deb7c85984 100644 --- a/lib/std/target.zig +++ b/lib/std/target.zig @@ -96,8 +96,12 @@ pub const Target = struct { win10_rs4 = 0x0A000005, win10_rs5 = 0x0A000006, win10_19h1 = 0x0A000007, + win10_20h1 = 0x0A000008, _, + /// Latest Windows version that the Zig Standard Library is aware of + pub const latest = WindowsVersion.win10_20h1; + pub const Range = struct { min: WindowsVersion, max: WindowsVersion, @@ -124,16 +128,17 @@ pub const Target = struct { out_stream: anytype, ) !void { if (fmt.len > 0 and fmt[0] == 's') { - if (@enumToInt(self) >= @enumToInt(WindowsVersion.nt4) and @enumToInt(self) <= @enumToInt(WindowsVersion.win10_19h1)) { + if (@enumToInt(self) >= @enumToInt(WindowsVersion.nt4) and @enumToInt(self) <= @enumToInt(WindowsVersion.latest)) { try std.fmt.format(out_stream, ".{}", .{@tagName(self)}); } else { - try std.fmt.format(out_stream, "@intToEnum(Target.Os.WindowsVersion, {})", .{@enumToInt(self)}); + // TODO this code path breaks zig triples, but it is used in `builtin` + try std.fmt.format(out_stream, "@intToEnum(Target.Os.WindowsVersion, 0x{X:0>8})", .{@enumToInt(self)}); } } else { - if (@enumToInt(self) >= @enumToInt(WindowsVersion.nt4) and @enumToInt(self) <= @enumToInt(WindowsVersion.win10_19h1)) { + if (@enumToInt(self) >= @enumToInt(WindowsVersion.nt4) and @enumToInt(self) <= @enumToInt(WindowsVersion.latest)) { try std.fmt.format(out_stream, "WindowsVersion.{}", .{@tagName(self)}); } else { - try std.fmt.format(out_stream, "WindowsVersion({})", .{@enumToInt(self)}); + try std.fmt.format(out_stream, "WindowsVersion(0x{X:0>8})", .{@enumToInt(self)}); } } } @@ -278,7 +283,7 @@ pub const Target = struct { .windows => return .{ .windows = .{ .min = .win8_1, - .max = .win10_19h1, + .max = WindowsVersion.latest, }, }, } diff --git a/lib/std/zig/system.zig b/lib/std/zig/system.zig index 175b0e4555..d24e8a57e9 100644 --- a/lib/std/zig/system.zig +++ b/lib/std/zig/system.zig @@ -249,7 +249,7 @@ pub const NativeTargetInfo = struct { // values const known_build_numbers = [_]u32{ 10240, 10586, 14393, 15063, 16299, 17134, 17763, - 18362, 18363, + 18362, 19041, }; var last_idx: usize = 0; for (known_build_numbers) |build, i| {