mirror-chatterino2/src/util/AttachToConsole.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
424 B
C++
Raw Normal View History

#include "util/AttachToConsole.hpp"
2021-03-13 12:40:43 +01:00
#ifdef USEWINSDK
# include <Windows.h>
# include <cstdio>
# include <tuple>
2021-03-13 12:40:43 +01:00
#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);
2021-03-13 12:40:43 +01:00
}
#endif
}
} // namespace chatterino