mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-27 19:09:47 +03:00
windows: use ProcessPrng from bcryptprimitives.dll
rather than SystemFunction036 from advapi32. This has the advantage that the code is loaded preemptively, preventing random numbers from failing when they are needed for the first time on a system under heavy load.
This commit is contained in:
@@ -32,7 +32,6 @@ pub fn build(b: *std.Build) void {
|
||||
}),
|
||||
});
|
||||
exe.subsystem = .console;
|
||||
exe.root_module.linkSystemLibrary("advapi32", .{}); // for RtlGenRandom
|
||||
exe.root_module.linkSystemLibrary("kernel32", .{});
|
||||
exe.root_module.linkSystemLibrary("ntdll", .{});
|
||||
exe.root_module.addObject(obj);
|
||||
|
||||
@@ -12,7 +12,6 @@ pub fn build(b: *std.Build) void {
|
||||
test_obj.root_module.linkSystemLibrary("ntdll", .{});
|
||||
test_obj.root_module.linkSystemLibrary("kernel32", .{});
|
||||
test_obj.root_module.linkSystemLibrary("ws2_32", .{});
|
||||
test_obj.root_module.linkSystemLibrary("advapi32", .{}); // for RtlGenRandom
|
||||
}
|
||||
|
||||
const test_exe_mod = b.createModule(.{
|
||||
|
||||
@@ -86,7 +86,6 @@ pub fn build(b: *std.Build) !void {
|
||||
.optimize = optimize,
|
||||
}),
|
||||
});
|
||||
lib_msvc.root_module.linkSystemLibrary("advapi32", .{}); // for RtlGenRandom
|
||||
const verify_msvc = b.addExecutable(.{
|
||||
.name = "verify-msvc",
|
||||
.root_module = b.createModule(.{
|
||||
|
||||
Reference in New Issue
Block a user