diff --git a/AUTHORS.md b/AUTHORS.md index ec1b0df3..68fbace3 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -14,3 +14,4 @@ We'd like to thank the following people for their contributions. * Trevor Martin [https://github.com/trelemar] * 8_BIT-DEV [https://github.com/8-BIT-DEV] * catsanddo [https://github.com/catsanddo] + * Kaspar Martin Suursalu [https://github.com/Kasparsu] diff --git a/src/main.c b/src/main.c index b1c099d8..d1e28720 100644 --- a/src/main.c +++ b/src/main.c @@ -268,6 +268,14 @@ char* resolveEntryPath(ENGINE* engine, char* entryArgument, bool autoResolve) { int main(int argc, char* argv[]) { +#ifdef __MINGW32__ + if(!GetStdHandle(STD_OUTPUT_HANDLE)) { + if (AttachConsole(ATTACH_PARENT_PROCESS)) { + freopen("CONOUT$","wb",stdout); + freopen("CONOUT$","wb",stderr); + } + } +#endif // configuring the buffer has to be first setbuf(stdout, NULL);