Fix console output on Windows (#2122)

Co-authored-by: pants64DS <pants64DS@users.noreply.github.com>
This commit is contained in:
pants64DS 2024-08-02 03:21:37 +03:00 committed by GitHub
parent 757a608b6e
commit 76c2723f5c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -361,6 +361,12 @@ int main(int argc, char** argv)
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);
printf("\n\n>");