From 9f5412fa9d040a9a15dc30579a8e3b8941b6448f Mon Sep 17 00:00:00 2001 From: fredb Date: Wed, 27 Sep 2006 20:16:32 +0000 Subject: [PATCH] Win32 only : Don't alloc a console when it is not needed --- simgear/debug/logstream.cxx | 3 +++ simgear/debug/logstream.hxx | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/simgear/debug/logstream.cxx b/simgear/debug/logstream.cxx index 255eae07..0a360941 100644 --- a/simgear/debug/logstream.cxx +++ b/simgear/debug/logstream.cxx @@ -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; diff --git a/simgear/debug/logstream.hxx b/simgear/debug/logstream.hxx index 98e5e326..3bc49a76 100644 --- a/simgear/debug/logstream.hxx +++ b/simgear/debug/logstream.hxx @@ -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(); -- 2.39.5