mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
23 lines
424 B
C++
23 lines
424 B
C++
#include "util/AttachToConsole.hpp"
|
|
|
|
#ifdef USEWINSDK
|
|
# include <Windows.h>
|
|
|
|
# include <cstdio>
|
|
# include <tuple>
|
|
#endif
|
|
|
|
namespace chatterino {
|
|
|
|
void attachToConsole()
|
|
{
|
|
#ifdef USEWINSDK
|
|
if (AttachConsole(ATTACH_PARENT_PROCESS))
|
|
{
|
|
std::ignore = freopen_s(nullptr, "CONOUT$", "w", stdout);
|
|
std::ignore = freopen_s(nullptr, "CONOUT$", "w", stderr);
|
|
}
|
|
#endif
|
|
}
|
|
|
|
} // namespace chatterino
|