@@ -734,24 +734,21 @@ pub fn call_wWinMain() std.os.windows.INT {
734734 // - u32 in PEB.ProcessParameters.dwShowWindow
735735 // Since STARTUPINFO is the bottleneck for the allowed values, we use `u16` as the
736736 // type which can coerce into i32/c_int/u32 depending on how the user defines their wWinMain
737- // (the Win32 docs show wWinMain with `int` as the type for nCmdShow ).
738- const nCmdShow : u16 = nCmdShow : {
739- // This makes Zig match the nCmdShow behavior of a C program with a WinMain symbol:
737+ // (the Win32 docs show wWinMain with `int` as the type for nShowCmd ).
738+ const nShowCmd : u16 = nShowCmd : {
739+ // This makes Zig match the nShowCmd behavior of a C program with a WinMain symbol:
740740 // - With STARTF_USESHOWWINDOW set in STARTUPINFO.dwFlags of the CreateProcess call:
741- // - Compiled with subsystem:console -> nCmdShow is always SW_SHOWDEFAULT
742- // - Compiled with subsystem:windows -> nCmdShow is STARTUPINFO.wShowWindow from
743- // the parent CreateProcess call
741+ // - nShowCmd is STARTUPINFO.wShowWindow from the parent CreateProcess call
744742 // - With STARTF_USESHOWWINDOW unset:
745- // - nCmdShow is always SW_SHOWDEFAULT
743+ // - nShowCmd is always SW_SHOWDEFAULT
746744 const SW_SHOWDEFAULT = 10 ;
747745 const STARTF_USESHOWWINDOW = 1 ;
748- // root having a wWinMain means that std.builtin.subsystem will always have a non-null value.
749- if (std .builtin .subsystem .? == .Windows and peb .ProcessParameters .dwFlags & STARTF_USESHOWWINDOW != 0 ) {
750- break :nCmdShow @truncate (peb .ProcessParameters .dwShowWindow );
746+ if (peb .ProcessParameters .dwFlags & STARTF_USESHOWWINDOW != 0 ) {
747+ break :nShowCmd @truncate (peb .ProcessParameters .dwShowWindow );
751748 }
752- break :nCmdShow SW_SHOWDEFAULT ;
749+ break :nShowCmd SW_SHOWDEFAULT ;
753750 };
754751
755752 // second parameter hPrevInstance, MSDN: "This parameter is always NULL"
756- return root .wWinMain (hInstance , null , lpCmdLine , nCmdShow );
753+ return root .wWinMain (hInstance , null , lpCmdLine , nShowCmd );
757754}
0 commit comments