Skip to content
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

Fix compilation, again #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
12 changes: 6 additions & 6 deletions src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub fn initRNG() !void {
//rnd setup -- https://ziglearn.org/chapter-2/#random-numbers
var prng = std.rand.DefaultPrng.init(blk: {
var seed: u64 = undefined;
try std.os.getrandom(std.mem.asBytes(&seed));
try std.posix.getrandom(std.mem.asBytes(&seed));
break :blk seed;
});
rand = prng.random();
Expand Down Expand Up @@ -145,14 +145,14 @@ pub fn initColor() void {
// defer freeColor(); just too lazy right now.

//get terminal size given a tty
pub fn getTermSz(tty: std.os.fd_t) !TermSz {
pub fn getTermSz(tty: std.posix.fd_t) !TermSz {
var winsz = c.winsize{ .ws_col = 0, .ws_row = 0, .ws_xpixel = 0, .ws_ypixel = 0 };
const rv = std.os.system.ioctl(tty, TIOCGWINSZ, @intFromPtr(&winsz));
const err = std.os.errno(rv);
const rv = std.os.linux.ioctl(tty, TIOCGWINSZ, @intFromPtr(&winsz));
const err = std.posix.errno(rv);
if (rv == 0) {
return TermSz{ .height = winsz.ws_row, .width = winsz.ws_col };
} else {
return std.os.unexpectedErrno(err);
return std.posix.unexpectedErrno(err);
}
}

Expand Down Expand Up @@ -189,7 +189,7 @@ pub fn pause() void {
if (b == 'q') {
//exit cleanly
complete();
std.os.exit(0);
std.process.exit(0);
}
}

Expand Down