Skip to content

Commit

Permalink
Allocate console only in debug configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ScriptedSnark committed Aug 2, 2024
1 parent 8ffeb00 commit 6e929f8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/SvenBXT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ void WaitUntilClientLoads()
goto lbl_waitFor;
}


void SvenBXT_Main()
{
if (g_bHasLoaded)
Expand Down Expand Up @@ -306,10 +305,12 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
#ifdef _DEBUG
AllocConsole();
FILE *in, *out;
freopen_s(&in, "conin$", "r", stdin);
freopen_s(&out, "conout$", "w+", stdout);
#endif
CreateThread(NULL, NULL, reinterpret_cast<LPTHREAD_START_ROUTINE>(SvenBXT_Main), NULL, NULL, NULL);
break;

Expand Down

0 comments on commit 6e929f8

Please sign in to comment.