Fix console output on Windows (#2122)
Co-authored-by: pants64DS <pants64DS@users.noreply.github.com>
This commit is contained in:
parent
757a608b6e
commit
76c2723f5c
|
@ -361,6 +361,12 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
int CALLBACK WinMain(HINSTANCE hinst, HINSTANCE hprev, LPSTR cmdline, int cmdshow)
|
int CALLBACK WinMain(HINSTANCE hinst, HINSTANCE hprev, LPSTR cmdline, int cmdshow)
|
||||||
{
|
{
|
||||||
|
if (AttachConsole(ATTACH_PARENT_PROCESS) && GetStdHandle(STD_OUTPUT_HANDLE))
|
||||||
|
{
|
||||||
|
freopen("CONOUT$", "w", stdout);
|
||||||
|
freopen("CONOUT$", "w", stderr);
|
||||||
|
}
|
||||||
|
|
||||||
int ret = main(__argc, __argv);
|
int ret = main(__argc, __argv);
|
||||||
|
|
||||||
printf("\n\n>");
|
printf("\n\n>");
|
||||||
|
|
Loading…
Reference in New Issue