update standalone tests for ws2_32 dependency

This commit is contained in:
Andrew Kelley 2025-10-27 19:47:20 -07:00
parent 135ec79f50
commit 030ddc7952
2 changed files with 2 additions and 1 deletions

View File

@ -11,6 +11,7 @@ pub fn build(b: *std.Build) void {
if (is_windows) { if (is_windows) {
test_obj.linkSystemLibrary("ntdll"); test_obj.linkSystemLibrary("ntdll");
test_obj.linkSystemLibrary("kernel32"); test_obj.linkSystemLibrary("kernel32");
test_obj.linkSystemLibrary("ws2_32");
} }
const test_exe_mod = b.createModule(.{ const test_exe_mod = b.createModule(.{

View File

@ -224,7 +224,7 @@ fn renameExe(dir: std.fs.Dir, old_sub_path: []const u8, new_sub_path: []const u8
error.AccessDenied => { error.AccessDenied => {
if (attempt == 13) return error.AccessDenied; if (attempt == 13) return error.AccessDenied;
// give the kernel a chance to finish closing the executable handle // give the kernel a chance to finish closing the executable handle
std.os.windows.kernel32.Sleep(@as(u32, 1) << attempt >> 1); _ = std.os.windows.kernel32.SleepEx(@as(u32, 1) << attempt >> 1, std.os.windows.FALSE);
attempt += 1; attempt += 1;
continue; continue;
}, },