mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
Merge pull request #19120 from jacobly0/os-cleanup
posix: fix socket fd leak
This commit is contained in:
commit
a1b083b666
2 changed files with 163 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`.
|
/// Checks if system is guaranteed to be at least `version` or older than `version`.
|
||||||
/// Returns `null` if a runtime check is required.
|
/// 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;
|
if (self.tag != tag) return false;
|
||||||
|
|
||||||
return switch (tag) {
|
return switch (tag) {
|
||||||
|
|
|
||||||
370
lib/std/os.zig
370
lib/std/os.zig
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue