]> git.mxchange.org Git - simgear.git/commitdiff
Win32 only : Don't alloc a console when it is not needed
authorfredb <fredb>
Wed, 27 Sep 2006 20:16:32 +0000 (20:16 +0000)
committerfredb <fredb>
Wed, 27 Sep 2006 20:16:32 +0000 (20:16 +0000)
simgear/debug/logstream.cxx
simgear/debug/logstream.hxx

index 255eae07a88542f5580d6f48e3ae72d5cabd49ad..0a360941dcf0a63965a66114e6df48315306b04f 100644 (file)
@@ -25,6 +25,9 @@
 logstream *global_logstream = NULL;
 
 bool            logbuf::logging_enabled = true;
+#ifdef _MSC_VER
+   bool         logbuf::has_console = true;
+#endif
 sgDebugClass    logbuf::logClass        = SG_NONE;
 sgDebugPriority logbuf::logPriority     = SG_INFO;
 streambuf*      logbuf::sbuf            = NULL;
index 98e5e3269e37ed3057aed7c6192670b71e86f9a1..3bc49a767522ad3435acf5555c8d6d6475fd1398 100644 (file)
@@ -139,6 +139,10 @@ public:
      */
     void set_sb( streambuf* sb );
 
+#ifdef _MSC_VER
+    static void has_no_console() { has_console = false; }
+#endif
+
 protected:
 
     /** sync/flush */
@@ -154,6 +158,9 @@ private:
     static streambuf* sbuf;
 
     static bool logging_enabled;
+#ifdef _MSC_VER
+    static bool has_console;
+#endif
     static sgDebugClass logClass;
     static sgDebugPriority logPriority;
 
@@ -184,7 +191,6 @@ inline logbuf::int_type
 logbuf::overflow( int c )
 {
 #ifdef _MSC_VER
-    static bool has_console = false;
     if ( logging_enabled ) {
         if ( !has_console ) {
             AllocConsole();