authorgravatar for anthonyarian96@gmail.comDixiE <anthonyarian96@gmail.com> 2020-10-23 00:34:32+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-10-22 19:50:06-04:00
log79ec08fe2f06f30f1759cb1f94e3ea162309e79b
tree85c5c76d41f4238f210166b9500afa8140646918
parentddd39b994b1eb9751d06227c6db02f15a5f71e9f

Fix Compiler Error When Using wWinMain Entry-Point

The fix for #6715 introduced a new compiler error when attempting to use wWinMain as the application entry-point. The Windows API often relies on implicit casts between signed and unsigned variables. In this case, wWinMain returns an INT despite the fact this value is intended to feed into ExitProcess, which expects a UINT, so I've restored the bitcast from #5613.

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

lib/std/start.zig+2-1
......@@ -173,7 +173,8 @@ fn wWinMainCRTStartup() callconv(.Stdcall) noreturn {
173173
174174 std.debug.maybeEnableSegfaultHandler();
175175
176 std.os.windows.kernel32.ExitProcess(initEventLoopAndCallWinMain());
176 const result: std.os.windows.INT = initEventLoopAndCallWinMain();
177 std.os.windows.kernel32.ExitProcess(@bitCast(std.os.windows.UINT, result));
177178}
178179
179180// TODO https://github.com/ziglang/zig/issues/265