authorgravatar for lucascarvalhosantos91@gmail.comLucas Santos <lucascarvalhosantos91@gmail.com> 2024-07-21 17:25:28-03:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-07-24 01:04:38-07:00
log1e74904aa27da423bcfe804a9b06fe8c0a0620ba
treecab85d439844bdd9010cc67dd15be73904a388f3
parentfa95c89a717f283215e9fd3ea0b8ebcd1599a69b

Replace some dynamic functions with static ones.

PR [19271](https://github.com/ziglang/zig/pull/19271) added some static function implementations from kernel32, but some parts of the library still used the dynamically loaded versions.

2 files changed, 3 insertions(+), 3 deletions(-)

lib/std/Thread.zig+1-1
......@@ -484,7 +484,7 @@ const WindowsThreadImpl = struct {
484484 pub const ThreadHandle = windows.HANDLE;
485485
486486 fn getCurrentId() windows.DWORD {
487 return windows.kernel32.GetCurrentThreadId();
487 return windows.GetCurrentThreadId();
488488 }
489489
490490 fn getCpuCount() !usize {
lib/std/debug.zig+2-2
......@@ -1750,7 +1750,7 @@ pub const WindowsModuleInfo = struct {
17501750 section_view: []const u8,
17511751
17521752 pub fn deinit(self: @This()) void {
1753 const process_handle = windows.kernel32.GetCurrentProcess();
1753 const process_handle = windows.GetCurrentProcess();
17541754 assert(windows.ntdll.NtUnmapViewOfSection(process_handle, @constCast(@ptrCast(self.section_view.ptr))) == .SUCCESS);
17551755 windows.CloseHandle(self.section_handle);
17561756 self.file.close();
......@@ -1980,7 +1980,7 @@ pub const DebugInfo = struct {
19801980 // openFileAbsoluteW requires the prefix to be present
19811981 @memcpy(name_buffer[0..4], &[_]u16{ '\\', '?', '?', '\\' });
19821982
1983 const process_handle = windows.kernel32.GetCurrentProcess();
1983 const process_handle = windows.GetCurrentProcess();
19841984 const len = windows.kernel32.GetModuleFileNameExW(
19851985 process_handle,
19861986 module.handle,