mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
posix: @as and other general cleanup
This commit is contained in:
parent
17d0bb5bea
commit
f446d8e8f9
2 changed files with 158 additions and 212 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
365
lib/std/os.zig
365
lib/std/os.zig
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue