mirror-chatterino2/src/util/AttachToConsole.cpp

21 lines
325 B
C++
Raw Normal View History

2021-03-13 12:40:43 +01:00
#include "AttachToConsole.hpp"
#ifdef USEWINSDK
# include <Windows.h>
#endif
namespace chatterino {
void attachToConsole()
{
#ifdef USEWINSDK
if (AttachConsole(ATTACH_PARENT_PROCESS))
{
freopen("CONOUT$", "w", stdout);
freopen("CONOUT$", "w", stderr);
}
#endif
}
} // namespace chatterino