Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compile error due to GetModuleFileNameW binding change #20861

Merged

Conversation

squeek502
Copy link
Collaborator

@squeek502 squeek502 commented Jul 29, 2024

In #19641 (cc @The-King-of-Toasters), this binding changed from [*]u16 to LPWSTR which made it a sentinel-terminated pointer. This introduced a compile 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: #20858


Note: Neither std.os.windows.kernel32.GetModuleFileNameW nor std.os.windows.GetModuleFileNameW is used by Zig internally (instead, std.os.windows.kernel32.GetModuleFileNameExW is used in std.debug). So an alternate fix here might be to just delete the binding and the wrapper in std.os.windows.

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
@andrewrk andrewrk merged commit efde3ed into ziglang:master Jul 29, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants