posix: @as and other general cleanup

This commit is contained in:
Jacob Young 2024-02-28 03:42:21 +01:00
parent 17d0bb5bea
commit f446d8e8f9
2 changed files with 158 additions and 212 deletions

View file

@ -392,7 +392,10 @@ pub const Os = struct {
/// Checks if system is guaranteed to be at least `version` or older than `version`.
/// Returns `null` if a runtime check is required.
pub inline fn isAtLeast(self: Os, comptime tag: Tag, version: anytype) ?bool {
pub inline fn isAtLeast(self: Os, comptime tag: Tag, version: switch (tag) {
else => std.SemanticVersion,
.windows => WindowsVersion,
}) ?bool {
if (self.tag != tag) return false;
return switch (tag) {

File diff suppressed because it is too large Load diff