Skip to content

Commit

Permalink
Fix compile error due to GetModuleFileNameW binding change
Browse files Browse the repository at this point in the history
In ziglang#19641, this binding changed from `[*]u16` to `LPWSTR` which made it a sentinel-terminated pointer. This introduced a compiler error in the `std.os.windows.GetModuleFileNameW` wrapper since it takes a `[*]u16` pointer. This commit changes the binding back to what it was before instead of introducing a breaking change to `std.os.windows.GetModuleFileNameW`

Related: ziglang#20858
  • Loading branch information
squeek502 authored and SammyJames committed Aug 7, 2024
1 parent 0ceb469 commit f5b5c7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/std/os/windows/kernel32.zig
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ pub extern "kernel32" fn GetProcessHeap() callconv(WINAPI) ?HANDLE;
// TODO: Wrapper around LdrGetDllFullName.
pub extern "kernel32" fn GetModuleFileNameW(
hModule: ?HMODULE,
lpFilename: LPWSTR,
lpFilename: [*]WCHAR,
nSize: DWORD,
) callconv(WINAPI) DWORD;

Expand Down

0 comments on commit f5b5c7a

Please sign in to comment.