| ... | @@ -96,8 +96,12 @@ pub const Target = struct { | ... | @@ -96,8 +96,12 @@ pub const Target = struct { |
| 96 | win10_rs4 = 0x0A000005, | 96 | win10_rs4 = 0x0A000005, |
| 97 | win10_rs5 = 0x0A000006, | 97 | win10_rs5 = 0x0A000006, |
| 98 | win10_19h1 = 0x0A000007, | 98 | win10_19h1 = 0x0A000007, |
| | 99 | win10_20h1 = 0x0A000008, |
| 99 | _, | 100 | _, |
| 100 | | 101 | |
| | 102 | /// Latest Windows version that the Zig Standard Library is aware of |
| | 103 | pub const latest = WindowsVersion.win10_20h1; |
| | 104 | |
| 101 | pub const Range = struct { | 105 | pub const Range = struct { |
| 102 | min: WindowsVersion, | 106 | min: WindowsVersion, |
| 103 | max: WindowsVersion, | 107 | max: WindowsVersion, |
| ... | @@ -124,16 +128,17 @@ pub const Target = struct { | ... | @@ -124,16 +128,17 @@ pub const Target = struct { |
| 124 | out_stream: anytype, | 128 | out_stream: anytype, |
| 125 | ) !void { | 129 | ) !void { |
| 126 | if (fmt.len > 0 and fmt[0] == 's') { | 130 | if (fmt.len > 0 and fmt[0] == 's') { |
| 127 | if (@enumToInt(self) >= @enumToInt(WindowsVersion.nt4) and @enumToInt(self) <= @enumToInt(WindowsVersion.win10_19h1)) { | 131 | if (@enumToInt(self) >= @enumToInt(WindowsVersion.nt4) and @enumToInt(self) <= @enumToInt(WindowsVersion.latest)) { |
| 128 | try std.fmt.format(out_stream, ".{}", .{@tagName(self)}); | 132 | try std.fmt.format(out_stream, ".{}", .{@tagName(self)}); |
| 129 | } else { | 133 | } else { |
| 130 | try std.fmt.format(out_stream, "@intToEnum(Target.Os.WindowsVersion, {})", .{@enumToInt(self)}); | 134 | // TODO this code path breaks zig triples, but it is used in `builtin` |
| | 135 | try std.fmt.format(out_stream, "@intToEnum(Target.Os.WindowsVersion, 0x{X:0>8})", .{@enumToInt(self)}); |
| 131 | } | 136 | } |
| 132 | } else { | 137 | } else { |
| 133 | if (@enumToInt(self) >= @enumToInt(WindowsVersion.nt4) and @enumToInt(self) <= @enumToInt(WindowsVersion.win10_19h1)) { | 138 | if (@enumToInt(self) >= @enumToInt(WindowsVersion.nt4) and @enumToInt(self) <= @enumToInt(WindowsVersion.latest)) { |
| 134 | try std.fmt.format(out_stream, "WindowsVersion.{}", .{@tagName(self)}); | 139 | try std.fmt.format(out_stream, "WindowsVersion.{}", .{@tagName(self)}); |
| 135 | } else { | 140 | } else { |
| 136 | try std.fmt.format(out_stream, "WindowsVersion({})", .{@enumToInt(self)}); | 141 | try std.fmt.format(out_stream, "WindowsVersion(0x{X:0>8})", .{@enumToInt(self)}); |
| 137 | } | 142 | } |
| 138 | } | 143 | } |
| 139 | } | 144 | } |
| ... | @@ -278,7 +283,7 @@ pub const Target = struct { | ... | @@ -278,7 +283,7 @@ pub const Target = struct { |
| 278 | .windows => return .{ | 283 | .windows => return .{ |
| 279 | .windows = .{ | 284 | .windows = .{ |
| 280 | .min = .win8_1, | 285 | .min = .win8_1, |
| 281 | .max = .win10_19h1, | 286 | .max = WindowsVersion.latest, |
| 282 | }, | 287 | }, |
| 283 | }, | 288 | }, |
| 284 | } | 289 | } |