]> git.mxchange.org Git - simgear.git/commitdiff
Windows logging tweaks.
authorJames Turner <zakalawe@mac.com>
Thu, 7 Feb 2013 17:23:31 +0000 (17:23 +0000)
committerJames Turner <zakalawe@mac.com>
Thu, 7 Feb 2013 17:23:31 +0000 (17:23 +0000)
Restore the freopen calls, though I am unsure exactly what they achieve.

simgear/debug/logstream.cxx

index 91ee4ebe0b6b2bdfb1a34c0970668cb0a82f4519..207f38964fe10c6366b7de923fc8b38d828a895d 100644 (file)
 
 #include <simgear/misc/sg_path.hxx>
 
+#ifdef _WIN32
+// for AllocConsole
+    #include "windows.h"
+#endif
+
 const char* debugClassToString(sgDebugClass c)
 {
     switch (c) {
@@ -97,6 +102,9 @@ public:
     {
 #ifdef _WIN32
         AllocConsole(); // but only if we want a console
+        freopen("conin$", "r", stdin);
+        freopen("conout$", "w", stdout);
+        freopen("conout$", "w", stderr);
 #endif
     }