build: update zig
This commit is contained in:
parent
5c5fa22c68
commit
314b8d4909
7 changed files with 17 additions and 17 deletions
|
@ -1 +1 @@
|
|||
0.12.0-dev.3059+27f589dea
|
||||
0.12.0-dev.3405+31791ae15
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
.hash = "1220882e05fd3aad5cfdcf13b988b0ecb26a7009870379a1e7aa7fad9e2486b3a8fa",
|
||||
},
|
||||
.clap = .{
|
||||
.url = "https://github.com/Hejsil/zig-clap/archive/9c23bcb5aebe0c2542b4de4472f60959974e2222.tar.gz",
|
||||
.hash = "12209e829da9d7d0bc089e4e0cbc07bb882f6192cd583277277da34df53cd05b8f2a",
|
||||
.url = "https://github.com/Hejsil/zig-clap/archive/209ba4da76e46412acfe18f711cb0b041ff37f10.tar.gz",
|
||||
.hash = "12200103e7b4a0cb162f2912df4fe97914024a25b5c9fcce6ea4119744f3f2a7f24e",
|
||||
},
|
||||
.tracy = .{
|
||||
.url = "https://github.com/neurocyte/zig-tracy/archive/d2113e7d778ebe7a063e95b5182ff145343aac38.tar.gz",
|
||||
|
|
18
src/main.zig
18
src/main.zig
|
@ -36,7 +36,7 @@ pub fn main() anyerror!void {
|
|||
|
||||
if (builtin.os.tag == .linux) {
|
||||
// drain stdin so we don't pickup junk from previous application/shell
|
||||
_ = std.os.linux.syscall3(.ioctl, @as(usize, @bitCast(@as(isize, std.os.STDIN_FILENO))), std.os.linux.T.CFLSH, 0);
|
||||
_ = std.os.linux.syscall3(.ioctl, @as(usize, @bitCast(@as(isize, std.posix.STDIN_FILENO))), std.os.linux.T.CFLSH, 0);
|
||||
}
|
||||
|
||||
const a = std.heap.c_allocator;
|
||||
|
@ -56,7 +56,7 @@ pub fn main() anyerror!void {
|
|||
if (res.args.help != 0)
|
||||
return clap.help(std.io.getStdErr().writer(), clap.Help, ¶ms, .{});
|
||||
|
||||
if (std.os.getenv("JITDEBUG")) |_| thespian.install_debugger();
|
||||
if (std.posix.getenv("JITDEBUG")) |_| thespian.install_debugger();
|
||||
|
||||
if (res.args.@"debug-wait" != 0) {
|
||||
std.debug.print("press return to start", .{});
|
||||
|
@ -196,9 +196,9 @@ extern fn ___tracy_emit_message(txt: [*]const u8, size: usize, callstack: c_int)
|
|||
fn exit(status: u8) noreturn {
|
||||
if (builtin.os.tag == .linux) {
|
||||
// drain stdin so we don't leave junk at the next prompt
|
||||
_ = std.os.linux.syscall3(.ioctl, @as(usize, @bitCast(@as(isize, std.os.STDIN_FILENO))), std.os.linux.T.CFLSH, 0);
|
||||
_ = std.os.linux.syscall3(.ioctl, @as(usize, @bitCast(@as(isize, std.posix.STDIN_FILENO))), std.os.linux.T.CFLSH, 0);
|
||||
}
|
||||
std.os.exit(status);
|
||||
std.posix.exit(status);
|
||||
}
|
||||
|
||||
const config = @import("config");
|
||||
|
@ -261,14 +261,14 @@ pub fn get_config_dir() ![]const u8 {
|
|||
|
||||
fn get_app_config_dir(appname: []const u8) ![]const u8 {
|
||||
const local = struct {
|
||||
var config_dir_buffer: [std.os.PATH_MAX]u8 = undefined;
|
||||
var config_dir_buffer: [std.posix.PATH_MAX]u8 = undefined;
|
||||
var config_dir: ?[]const u8 = null;
|
||||
};
|
||||
const config_dir = if (local.config_dir) |dir|
|
||||
dir
|
||||
else if (std.os.getenv("XDG_CONFIG_HOME")) |xdg|
|
||||
else if (std.posix.getenv("XDG_CONFIG_HOME")) |xdg|
|
||||
try std.fmt.bufPrint(&local.config_dir_buffer, "{s}/{s}", .{ xdg, appname })
|
||||
else if (std.os.getenv("HOME")) |home|
|
||||
else if (std.posix.getenv("HOME")) |home|
|
||||
try std.fmt.bufPrint(&local.config_dir_buffer, "{s}/.config/{s}", .{ home, appname })
|
||||
else
|
||||
return error.AppConfigDirUnavailable;
|
||||
|
@ -282,7 +282,7 @@ fn get_app_config_dir(appname: []const u8) ![]const u8 {
|
|||
|
||||
fn get_app_config_file_name(appname: []const u8) ![]const u8 {
|
||||
const local = struct {
|
||||
var config_file_buffer: [std.os.PATH_MAX]u8 = undefined;
|
||||
var config_file_buffer: [std.posix.PATH_MAX]u8 = undefined;
|
||||
var config_file: ?[]const u8 = null;
|
||||
};
|
||||
const config_file_name = "config.json";
|
||||
|
@ -300,7 +300,7 @@ pub fn get_config_file_name() ![]const u8 {
|
|||
|
||||
pub fn get_restore_file_name() ![]const u8 {
|
||||
const local = struct {
|
||||
var restore_file_buffer: [std.os.PATH_MAX]u8 = undefined;
|
||||
var restore_file_buffer: [std.posix.PATH_MAX]u8 = undefined;
|
||||
var restore_file: ?[]const u8 = null;
|
||||
};
|
||||
const restore_file_name = "restore";
|
||||
|
|
|
@ -167,7 +167,7 @@ pub fn Collection(comptime Namespace: type) type {
|
|||
const Fields = @Type(.{
|
||||
.Struct = .{
|
||||
.is_tuple = false,
|
||||
.layout = .Auto,
|
||||
.layout = .auto,
|
||||
.decls = &.{},
|
||||
.fields = &fields,
|
||||
},
|
||||
|
|
|
@ -247,7 +247,7 @@ const Fire = struct {
|
|||
.plane = plane,
|
||||
.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;
|
||||
}),
|
||||
.FIRE_H = FIRE_H,
|
||||
|
|
|
@ -203,7 +203,7 @@ fn show_project(self: *Self) void {
|
|||
|
||||
fn abbrv_home(self: *Self) void {
|
||||
if (std.fs.path.isAbsolute(self.name)) {
|
||||
if (std.os.getenv("HOME")) |homedir| {
|
||||
if (std.posix.getenv("HOME")) |homedir| {
|
||||
const homerelpath = std.fs.path.relative(self.a, homedir, self.name) catch return;
|
||||
if (homerelpath.len == 0) {
|
||||
self.name = "~";
|
||||
|
|
|
@ -189,7 +189,7 @@ fn deinit(self: *Self) void {
|
|||
|
||||
fn listen_sigwinch(self: *Self) tp.result {
|
||||
if (self.sigwinch_signal) |old| old.deinit();
|
||||
self.sigwinch_signal = tp.signal.init(std.os.SIG.WINCH, tp.message.fmt(.{"sigwinch"})) catch |e| return tp.exit_error(e);
|
||||
self.sigwinch_signal = tp.signal.init(std.posix.SIG.WINCH, tp.message.fmt(.{"sigwinch"})) catch |e| return tp.exit_error(e);
|
||||
}
|
||||
|
||||
fn receive(self: *Self, from: tp.pid_ref, m: tp.message) tp.result {
|
||||
|
@ -854,7 +854,7 @@ const OSC22_cursor_reply = OSC ++ "22:";
|
|||
|
||||
pub fn set_terminal_title(text: []const u8) void {
|
||||
var writer = std.io.getStdOut().writer();
|
||||
var buf: [std.os.PATH_MAX]u8 = undefined;
|
||||
var buf: [std.posix.PATH_MAX]u8 = undefined;
|
||||
const term_cmd = std.fmt.bufPrint(&buf, OSC0_title ++ "{s}" ++ BEL, .{text}) catch return;
|
||||
_ = writer.write(term_cmd) catch return;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue