aboutsummaryrefslogtreecommitdiff
path: root/lib/std/start.zig
diff options
context:
space:
mode:
authorDixiE <anthonyarian96@gmail.com>2020-10-23 00:34:32 +0100
committerAndrew Kelley <andrew@ziglang.org>2020-10-22 19:50:06 -0400
commit79ec08fe2f06f30f1759cb1f94e3ea162309e79b (patch)
tree85c5c76d41f4238f210166b9500afa8140646918 /lib/std/start.zig
parentddd39b994b1eb9751d06227c6db02f15a5f71e9f (diff)
downloadzig-79ec08fe2f06f30f1759cb1f94e3ea162309e79b.tar.gz
zig-79ec08fe2f06f30f1759cb1f94e3ea162309e79b.zip
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.
Diffstat (limited to 'lib/std/start.zig')
-rw-r--r--lib/std/start.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/std/start.zig b/lib/std/start.zig
index c6f05e790c..47164a0820 100644
--- a/lib/std/start.zig
+++ b/lib/std/start.zig
@@ -173,7 +173,8 @@ fn wWinMainCRTStartup() callconv(.Stdcall) noreturn {
std.debug.maybeEnableSegfaultHandler();
- std.os.windows.kernel32.ExitProcess(initEventLoopAndCallWinMain());
+ const result: std.os.windows.INT = initEventLoopAndCallWinMain();
+ std.os.windows.kernel32.ExitProcess(@bitCast(std.os.windows.UINT, result));
}
// TODO https://github.com/ziglang/zig/issues/265