MISC 2: Windows has a right to stdout, enable it for both Digital Lab or Debug builds

This commit is contained in:
vsonnier 2016-06-09 19:21:43 +02:00
parent 4ec08b8b68
commit e7531952fe

View File

@ -24,6 +24,8 @@
IMPLEMENT_APP(CubicSDR)
#include <fstream>
//#ifdef ENABLE_DIGITAL_LAB
//// console output buffer for windows
//#ifdef _WINDOWS
@ -156,18 +158,21 @@ bool CubicSDR::OnInit() {
return false;
}
//#ifdef ENABLE_DIGITAL_LAB
// // console output for windows
// #ifdef _WINDOWS
// if (AllocConsole()) {
// freopen("CONOUT$", "w", stdout);
// SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED);
// }
// outbuf ob;
// std::streambuf *sb = std::cout.rdbuf(&ob);
// std::cout.rdbuf(sb);
// #endif
//#endif
// // console output for Windows: available in DEBUG or in case of ENABLE_DIGITAL_LAB
#if (defined(WIN32) && (defined(ENABLE_DIGITAL_LAB) || defined(_DEBUG)))
if (AllocConsole()) {
freopen("CONOUT$", "w", stdout);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED);
SetConsoleTitle(L"CubicSDR: stdout");
}
//refresh
ofstream ob;
std::streambuf *sb = std::cout.rdbuf();
std::cout.rdbuf(sb);
#endif
wxApp::SetAppName("CubicSDR");