Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
.name = .msvcup,
.fingerprint = 0xbd52518ef5381747,
.version = "0.0.0",
.minimum_zig_version = "0.14.1",
.minimum_zig_version = "0.15.2",
.dependencies = .{
.zipcmdline = .{
.url = "git+https://github.com/marler8997/zipcmdline#3dfca786a489d117e4b72ea10ffb4bbd9fc2dd72",
.hash = "12201a08d7eff7619c8eb8284691a3ff959861b4bdd87216f180ed136672fb4ea26f",
.url = "git+https://github.com/marler8997/zipcmdline#a6de65875023c52d2f56f21a31c6487266f8105f",
.hash = "zipcmdline-0.0.0-DFii07hmAwCFNhtMpml64Pj_hr8kN4WesClygZErQHsk",
},
.iobackport = .{
.url = "git+https://github.com/marler8997/zig-io-backport#2ce586882e0257f45f48a4d67e6b76defa0e45f1",
Expand Down
9 changes: 1 addition & 8 deletions src/StringPool.zig
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,7 @@ pub const Val = struct {
pub fn eql(self: Val, other: Val) bool {
return self.slice.ptr == other.slice.ptr;
}
pub fn format(
self: @This(),
comptime fmt: []const u8,
options: std.fmt.FormatOptions,
writer: anytype,
) !void {
_ = fmt;
_ = options;
pub fn format(self: @This(), writer: *std.Io.Writer) error{WriteFailed}!void {
return writer.writeAll(self.slice);
}
};
Expand Down
18 changes: 6 additions & 12 deletions src/autoenv.zig
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub fn main() !u8 {

const self_exe_file = getImagePathName() orelse @panic("no image path name");
const self_exe_paths = splitDirBasename(self_exe_file) orelse errExit(
"self exe path '{}' has no parent directory",
"self exe path '{f}' has no parent directory",
.{std.unicode.fmtUtf16Le(self_exe_file)},
);
std.debug.assert(self_exe_paths.basename.len > 0);
Expand Down Expand Up @@ -71,8 +71,9 @@ pub fn main() !u8 {
// fatal error C1090: PDB API call failed, error code '23': (0x000006BA)
const use_job = !std.mem.eql(u16, self_exe_paths.basename, L("cl.exe"));

const CREATE_SUSPENDED = 0x00000004;
const create_process_flags: u32 = if (use_job) CREATE_SUSPENDED else 0;
const create_process_flags: win32.CreateProcessFlags = .{
.create_suspended = use_job,
};
if (0 == win32.kernel32.CreateProcessW(
// L(exe_basename),
exe,
Expand Down Expand Up @@ -322,7 +323,7 @@ fn findExe(allocator: std.mem.Allocator, exe_basename: []const u16) !?[:0]u16 {
free_candidate = false;
return candidate_slice;
} else |err| switch (err) {
error.FileNotFound, error.PermissionDenied => {},
error.FileNotFound, error.AccessDenied => {},
error.Unexpected => |e| return e,
}
}
Expand Down Expand Up @@ -379,14 +380,7 @@ pub fn fmtError(error_code: win32.Win32Error) FormatError(300) {
pub fn FormatError(comptime max_len: usize) type {
return struct {
error_code: win32.Win32Error,
pub fn format(
self: @This(),
comptime fmt: []const u8,
options: std.fmt.FormatOptions,
writer: anytype,
) @TypeOf(writer).Error!void {
_ = fmt;
_ = options;
pub fn format(self: @This(), writer: *std.Io.Writer) error{WriteFailed}!void {
try writer.print("{} (", .{@intFromEnum(self.error_code)});
var buf: [max_len]u8 = undefined;
const len = FormatMessageA(
Expand Down
Loading
Loading