pty: remove usingns

This commit is contained in:
Mitchell Hashimoto
2024-08-16 10:37:31 -07:00
parent 3404f8e53a
commit 9f52a963f5

View File

@ -63,17 +63,15 @@ const PosixPty = struct {
const TIOCSWINSZ = if (builtin.os.tag == .macos) 2148037735 else c.TIOCSWINSZ; const TIOCSWINSZ = if (builtin.os.tag == .macos) 2148037735 else c.TIOCSWINSZ;
const TIOCGWINSZ = if (builtin.os.tag == .macos) 1074295912 else c.TIOCGWINSZ; const TIOCGWINSZ = if (builtin.os.tag == .macos) 1074295912 else c.TIOCGWINSZ;
extern "c" fn setsid() std.c.pid_t; extern "c" fn setsid() std.c.pid_t;
const c = struct { const c = switch (builtin.os.tag) {
usingnamespace switch (builtin.os.tag) { .macos => @cImport({
.macos => @cImport({ @cInclude("sys/ioctl.h"); // ioctl and constants
@cInclude("sys/ioctl.h"); // ioctl and constants @cInclude("util.h"); // openpty()
@cInclude("util.h"); // openpty() }),
}), else => @cImport({
else => @cImport({ @cInclude("sys/ioctl.h"); // ioctl and constants
@cInclude("sys/ioctl.h"); // ioctl and constants @cInclude("pty.h");
@cInclude("pty.h"); }),
}),
};
}; };
/// The file descriptors for the master and slave side of the pty. /// The file descriptors for the master and slave side of the pty.