| ... | ... | @@ -96,8 +96,12 @@ pub const Target = struct { |
| 96 | 96 | win10_rs4 = 0x0A000005, |
| 97 | 97 | win10_rs5 = 0x0A000006, |
| 98 | 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 | 105 | pub const Range = struct { |
| 102 | 106 | min: WindowsVersion, |
| 103 | 107 | max: WindowsVersion, |
| ... | ... | @@ -124,16 +128,17 @@ pub const Target = struct { |
| 124 | 128 | out_stream: anytype, |
| 125 | 129 | ) !void { |
| 126 | 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 | 132 | try std.fmt.format(out_stream, ".{}", .{@tagName(self)}); |
| 129 | 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 | 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 | 139 | try std.fmt.format(out_stream, "WindowsVersion.{}", .{@tagName(self)}); |
| 135 | 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 | 283 | .windows => return .{ |
| 279 | 284 | .windows = .{ |
| 280 | 285 | .min = .win8_1, |
| 281 | | .max = .win10_19h1, |
| 286 | .max = WindowsVersion.latest, |
| 282 | 287 | }, |
| 283 | 288 | }, |
| 284 | 289 | } |