| 31 | } |
| 32 | |
| 33 | bool cDebugger::ConsoleOpen() { |
| 34 | static bool Alloced = false; |
| 35 | |
| 36 | if (Alloced) |
| 37 | return true; |
| 38 | /* |
| 39 | #ifdef _CONSOLE |
| 40 | return true; |
| 41 | #endif*/ |
| 42 | if (g_Fodder->mParams->mAppVeyor) |
| 43 | return true; |
| 44 | |
| 45 | #ifdef WIN32 |
| 46 | static bool attached = AttachConsole(ATTACH_PARENT_PROCESS); |
| 47 | if (!attached) |
| 48 | attached = AllocConsole(); |
| 49 | |
| 50 | FILE *stream, *stream2, *stream3; |
| 51 | |
| 52 | freopen_s(&stream, "CONIN$", "r", stdin); |
| 53 | freopen_s(&stream2, "CONOUT$", "w", stdout); |
| 54 | freopen_s(&stream3, "CONOUT$", "w", stderr); |
| 55 | |
| 56 | Alloced = true; |
| 57 | std::ios::sync_with_stdio(true); |
| 58 | std::wcout.clear(); |
| 59 | std::cout.clear(); |
| 60 | std::wcerr.clear(); |
| 61 | std::cerr.clear(); |
| 62 | std::wcin.clear(); |
| 63 | std::cin.clear(); |
| 64 | #endif |
| 65 | return true; |
| 66 | } |
| 67 | |
| 68 | void cDebugger::ClearConsole() { |
| 69 | |