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 {...@@ -484,7 +484,7 @@ const WindowsThreadImpl = struct {
484 pub const ThreadHandle = windows.HANDLE;484 pub const ThreadHandle = windows.HANDLE;
485485
486 fn getCurrentId() windows.DWORD {486 fn getCurrentId() windows.DWORD {
487 return windows.kernel32.GetCurrentThreadId();487 return windows.GetCurrentThreadId();
488 }488 }
489489
490 fn getCpuCount() !usize {490 fn getCpuCount() !usize {
lib/std/debug.zig+2-2
...@@ -1750,7 +1750,7 @@ pub const WindowsModuleInfo = struct {...@@ -1750,7 +1750,7 @@ pub const WindowsModuleInfo = struct {
1750 section_view: []const u8,1750 section_view: []const u8,
17511751
1752 pub fn deinit(self: @This()) void {1752 pub fn deinit(self: @This()) void {
1753 const process_handle = windows.kernel32.GetCurrentProcess();1753 const process_handle = windows.GetCurrentProcess();
1754 assert(windows.ntdll.NtUnmapViewOfSection(process_handle, @constCast(@ptrCast(self.section_view.ptr))) == .SUCCESS);1754 assert(windows.ntdll.NtUnmapViewOfSection(process_handle, @constCast(@ptrCast(self.section_view.ptr))) == .SUCCESS);
1755 windows.CloseHandle(self.section_handle);1755 windows.CloseHandle(self.section_handle);
1756 self.file.close();1756 self.file.close();
...@@ -1980,7 +1980,7 @@ pub const DebugInfo = struct {...@@ -1980,7 +1980,7 @@ pub const DebugInfo = struct {
1980 // openFileAbsoluteW requires the prefix to be present1980 // openFileAbsoluteW requires the prefix to be present
1981 @memcpy(name_buffer[0..4], &[_]u16{ '\\', '?', '?', '\\' });1981 @memcpy(name_buffer[0..4], &[_]u16{ '\\', '?', '?', '\\' });
19821982
1983 const process_handle = windows.kernel32.GetCurrentProcess();1983 const process_handle = windows.GetCurrentProcess();
1984 const len = windows.kernel32.GetModuleFileNameExW(1984 const len = windows.kernel32.GetModuleFileNameExW(
1985 process_handle,1985 process_handle,
1986 module.handle,1986 module.handle,