enable win32 debug console when launching from console

This commit is contained in:
Stanislaw Halik 2018-12-08 01:29:14 +01:00
parent d791dcfbf3
commit 64e960aa22
5 changed files with 70 additions and 1 deletions

View file

@ -52,6 +52,11 @@ namespace Debug
int wrapApplication(int (*innerApplication)(int argc, char *argv[]), int argc, char *argv[], const std::string& appName)
{
#if defined _WIN32
// grab a console window if we don't have one
(void)Debug::attachParentConsole();
#endif
// Some objects used to redirect cout and cerr
// Scope must be here, so this still works inside the catch block for logging exceptions
std::streambuf* cout_rdbuf = std::cout.rdbuf ();