remove stage1 workarounds

This commit is contained in:
Mitchell Hashimoto
2022-11-15 13:19:01 -08:00
parent 4727fa9b7b
commit 78fbf9cb06
2 changed files with 4 additions and 9 deletions

View File

@@ -431,10 +431,7 @@ pub fn threadEnter(self: *const OpenGL, window: glfw.Window) !void {
// Load OpenGL bindings. This API is context-aware so this sets
// a threadlocal context for these pointers.
const version = try gl.glad.load(switch (builtin.zig_backend) {
.stage1 => glfw.getProcAddress,
else => &glfw.getProcAddress,
});
const version = try gl.glad.load(&glfw.getProcAddress);
errdefer gl.glad.unload();
log.info("loaded OpenGL {}.{}", .{
gl.glad.versionMajor(@intCast(c_uint, version)),

View File

@@ -91,6 +91,9 @@ pub fn init(alloc: Allocator, opts: termio.Options) !Exec {
.args = &[_][]const u8{path},
.env = &env,
.cwd = opts.config.@"working-directory",
.stdin = .{ .handle = pty.slave },
.stdout = .{ .handle = pty.slave },
.stderr = .{ .handle = pty.slave },
.pre_exec = (struct {
fn callback(cmd: *Command) void {
const p = cmd.getData(Pty) orelse unreachable;
@@ -100,11 +103,6 @@ pub fn init(alloc: Allocator, opts: termio.Options) !Exec {
}).callback,
.data = &pty,
};
// note: can't set these in the struct initializer because it
// sets the handle to "0". Probably a stage1 zig bug.
cmd.stdin = std.fs.File{ .handle = pty.slave };
cmd.stdout = cmd.stdin;
cmd.stderr = cmd.stdin;
try cmd.start(alloc);
log.info("started subcommand path={s} pid={?}", .{ path, cmd.pid });