diff --git a/Source/Client/CustomConsole.cxx b/Source/Client/CustomConsole.cxx index 0c3cb860..3088b331 100644 --- a/Source/Client/CustomConsole.cxx +++ b/Source/Client/CustomConsole.cxx @@ -2,9 +2,11 @@ #include +#ifdef _WIN32 #include #include #include +#endif #include #include @@ -17,10 +19,12 @@ namespace universelan::client { { tracer::Trace trace{ }; +#ifdef _WIN32 FILE* fDummy; freopen_s(&fDummy, "CONIN$", "r", stdin); freopen_s(&fDummy, "CONOUT$", "w", stderr); freopen_s(&fDummy, "CONOUT$", "w", stdout); +#endif //Clear the error state for each of the C++ standard stream objects. We need to do this, as //attempts to access the standard streams before they refer to a valid target will cause the @@ -48,6 +52,7 @@ namespace universelan::client { CustomConsoleEnabled = true; +#ifdef _WIN32 // allocate a console for this app AllocConsole(); @@ -57,5 +62,6 @@ namespace universelan::client { BindStdHandlesToConsole(); SetConsoleTitleA("UniverseLAN"); +#endif } } \ No newline at end of file