Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

Commit 71d0139

Browse files
authored
use stdlib over c includes (#183)
1 parent 8aea606 commit 71d0139

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/Display.zig

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,9 @@ pub fn init(location: *Self, allocator: std.mem.Allocator) !void {
147147
}
148148
},
149149
else => {
150-
const c = @cImport({
151-
@cInclude("sys/ioctl.h");
152-
@cInclude("unistd.h");
153-
});
154-
155-
var winsize: c.winsize = undefined;
156-
const rc = c.ioctl(0, c.TIOCGWINSZ, &winsize);
157-
if (rc != 0 or c.isatty(std.io.getStdOut().handle) != 1 or
150+
var winsize: std.os.linux.winsize = undefined;
151+
const rc = std.c.ioctl(0, std.os.linux.T.IOCGWINSZ, &winsize);
152+
if (rc != 0 or !std.os.isatty(std.io.getStdOut().handle) or
158153
std.process.hasEnvVarConstant("GYRO_DIRECT_LOG"))
159154
{
160155
location.* = Self{ .mode = .{ .direct_log = {} } };

0 commit comments

Comments
 (0)