diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-02-09 13:38:42 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-09 13:38:42 -0800 |
| commit | 54bbc73f8502fe073d385361ddb34a43d12eec39 (patch) | |
| tree | 6eb554a4639f2c05bdfa5fc94553edc7f5df1650 /src/main.zig | |
| parent | d3cf911a803912a5aabe7a8d130c8b6468b95ff1 (diff) | |
| parent | 318e9cdaaae2f01c1a6e5db9cf66fe875821787e (diff) | |
| download | zig-54bbc73f8502fe073d385361ddb34a43d12eec39.tar.gz zig-54bbc73f8502fe073d385361ddb34a43d12eec39.zip | |
Merge pull request #18712 from Vexu/std.options
std: make options a struct instance instead of a namespace
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/main.zig b/src/main.zig index b6463489bc..1a9c264b7d 100644 --- a/src/main.zig +++ b/src/main.zig @@ -29,27 +29,27 @@ const AstGen = @import("AstGen.zig"); const mingw = @import("mingw.zig"); const Server = std.zig.Server; -pub const std_options = struct { - pub const wasiCwd = wasi_cwd; - pub const logFn = log; - pub const enable_segfault_handler = false; +pub const std_options = .{ + .wasiCwd = wasi_cwd, + .logFn = log, + .enable_segfault_handler = false, - pub const log_level: std.log.Level = switch (builtin.mode) { + .log_level = switch (builtin.mode) { .Debug => .debug, .ReleaseSafe, .ReleaseFast => .info, .ReleaseSmall => .err, - }; + }, }; // Crash report needs to override the panic handler pub const panic = crash_report.panic; var wasi_preopens: fs.wasi.Preopens = undefined; -pub fn wasi_cwd() fs.Dir { +pub fn wasi_cwd() std.os.wasi.fd_t { // Expect the first preopen to be current working directory. const cwd_fd: std.os.fd_t = 3; assert(mem.eql(u8, wasi_preopens.names[cwd_fd], ".")); - return .{ .fd = cwd_fd }; + return cwd_fd; } fn getWasiPreopen(name: []const u8) Compilation.Directory { @@ -1335,8 +1335,6 @@ fn buildOutputType( create_module.each_lib_rpath = false; } else if (mem.eql(u8, arg, "--test-cmd-bin")) { try test_exec_args.append(null); - } else if (mem.eql(u8, arg, "--test-evented-io")) { - create_module.opts.test_evented_io = true; } else if (mem.eql(u8, arg, "--test-no-exec")) { test_no_exec = true; } else if (mem.eql(u8, arg, "-ftime-report")) { |
