send console output to parent process's console.
this way Windows release builds can get console output if run from cmd.exe, just like under Linux
This commit is contained in:
parent
affe1c084f
commit
24d6bd2786
|
@ -1666,8 +1666,17 @@ int CALLBACK WinMain(HINSTANCE hinst, HINSTANCE hprev, LPSTR cmdline, int cmdsho
|
|||
if (res != len) { delete[] argv[i]; argv[i] = nullarg; }
|
||||
}
|
||||
|
||||
if (AttachConsole(ATTACH_PARENT_PROCESS))
|
||||
{
|
||||
freopen("CONOUT$", "w", stdout);
|
||||
freopen("CONOUT$", "w", stderr);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
int ret = main(argc, argv);
|
||||
|
||||
printf("\n\n>");
|
||||
|
||||
for (int i = 0; i < argc; i++) if (argv[i] != nullarg) delete[] argv[i];
|
||||
delete[] argv;
|
||||
|
||||
|
|
Loading…
Reference in New Issue