Skip to content

List out posix compatibles #2548

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion std/io.zig
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ const fmt = std.fmt;
const File = std.os.File;
const testing = std.testing;

const is_posix = builtin.os != builtin.Os.windows;
const is_windows = builtin.os == builtin.Os.windows;
const is_posix = switch (builtin.os) {
.linux, .macosx, .freebsd, .netbsd => true,
else => false,
};

const GetStdIoErrs = os.WindowsGetStdHandleErrs;

Expand Down
2 changes: 1 addition & 1 deletion std/os.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const builtin = @import("builtin");
const Os = builtin.Os;
const is_windows = builtin.os == Os.windows;
const is_posix = switch (builtin.os) {
builtin.Os.linux, builtin.Os.macosx, builtin.Os.freebsd, builtin.Os.netbsd => true,
.linux, .macosx, .freebsd, .netbsd => true,
else => false,
};
const os = @This();
Expand Down
5 changes: 4 additions & 1 deletion std/os/file.zig
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ const Os = builtin.Os;
const windows_util = @import("windows/util.zig");
const maxInt = std.math.maxInt;

const is_posix = builtin.os != builtin.Os.windows;
const is_windows = builtin.os == builtin.Os.windows;
const is_posix = switch (builtin.os) {
.linux, .macosx, .freebsd, .netbsd => true,
else => false,
};

pub const File = struct {
/// The OS-specific file descriptor or file handle.
Expand Down