mirror of
https://github.com/ziglang/zig.git
synced 2026-01-21 14:55:25 +00:00
Fix & update windows version stuff (#6157)
* Update windows version constants * Add docs
This commit is contained in:
parent
9745e7b512
commit
140c599559
@ -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,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@ -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| {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user