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

Changes needed to compile with 0.14.0-dev.2569+30169d1d2 #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ pub fn build(b: *std.Build) void {
.optimize = optimize,
});

exe.linkLibC();

// This declares intent for the executable to be installed into the
// standard location when the user invokes the "install" step (the default
// step when running `zig build`).
Expand Down
8 changes: 4 additions & 4 deletions src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ var stdin: std.fs.File.Reader = undefined;
///////////////////////////////////

//// consts, vars, settings
var rand: std.rand.Random = undefined;
var rand: std.Random = undefined;

//// functions

// seed & prep for rng
pub fn initRNG() !void {
//rnd setup -- https://ziglearn.org/chapter-2/#random-numbers
var prng = std.rand.DefaultPrng.init(blk: {
var prng = std.Random.DefaultPrng.init(blk: {
var seed: u64 = undefined;
try std.posix.getrandom(std.mem.asBytes(&seed));
break :blk seed;
Expand Down Expand Up @@ -156,12 +156,12 @@ pub fn getTermSz(tty: std.posix.fd_t) !TermSz {
};
} else {
//Linux-MacOS Case
var winsz = std.c.winsize{ .ws_col = 0, .ws_row = 0, .ws_xpixel = 0, .ws_ypixel = 0 };
var winsz = std.c.winsize{ .col = 0, .row = 0, .xpixel = 0, .ypixel = 0 };
const rv = std.c.ioctl(tty, TIOCGWINSZ, @intFromPtr(&winsz));
const err = std.posix.errno(rv);

if (rv >= 0) {
return TermSz{ .height = winsz.ws_row, .width = winsz.ws_col };
return TermSz{ .height = winsz.row, .width = winsz.col };
} else {
std.process.exit(0);
//TODO this is a pretty terrible way to handle issues...
Expand Down