Skip to content
Merged
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
8 changes: 4 additions & 4 deletions win32exelink.zig
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ const exe_marker_len = 42;

// I'm exporting this and making it mutable to make sure the compiler keeps it around
// and prevent it from evaluting its contents at comptime
export var zig_exe_string: [exe_marker_len + std.fs.MAX_PATH_BYTES + 1]u8 =
("!!!THIS MARKS THE zig_exe_string MEMORY!!#" ++ ([1]u8{0} ** (std.fs.MAX_PATH_BYTES + 1))).*;
export var zig_exe_string: [exe_marker_len + std.fs.max_path_bytes + 1]u8 =
("!!!THIS MARKS THE zig_exe_string MEMORY!!#" ++ ([1]u8{0} ** (std.fs.max_path_bytes + 1))).*;

const global = struct {
var child: std.process.Child = undefined;
Expand All @@ -28,8 +28,8 @@ pub fn main() !u8 {
var zig_exe_len: usize = 1;
while (zig_exe_string[exe_marker_len + zig_exe_len] != 0) {
zig_exe_len += 1;
if (exe_marker_len + zig_exe_len > std.fs.MAX_PATH_BYTES) {
log.err("the zig target execuable is either too big (over {}) or the exe is corrupt", .{std.fs.MAX_PATH_BYTES});
if (exe_marker_len + zig_exe_len > std.fs.max_path_bytes) {
log.err("the zig target execuable is either too big (over {}) or the exe is corrupt", .{std.fs.max_path_bytes});
return 1;
}
}
Expand Down