From fd7c01c0aa911a7b9ae9a6048d93edefea5db1b0 Mon Sep 17 00:00:00 2001 From: xaedes Date: Tue, 31 Jan 2017 19:22:20 +0100 Subject: [PATCH] Fix issue #29 by applying logstream.hpp kludge only in WIN32 platforms when not compiling under MINGW. --- core/lib/Utilities/logstream.hpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/core/lib/Utilities/logstream.hpp b/core/lib/Utilities/logstream.hpp index e71d7c935..bb04329a0 100644 --- a/core/lib/Utilities/logstream.hpp +++ b/core/lib/Utilities/logstream.hpp @@ -81,7 +81,11 @@ template class Log /// string stream to which output is written; destructor will dump to log stream. std::ostringstream os; -#ifdef WIN32 // see kludge note below +#if !defined(USEKLUDGE) && defined(WIN32) && !(defined(__MINGW32__) || defined(__MINGW64__)) +#define USEKLUDGE +#endif + +#ifdef USEKLUDGE // see kludge note below static LogLevel reportingLevel; ///< static data for ReportingLevel() static bool dumpTimeTags; ///< static data for ReportTimeTags() static bool dumpLevels; ///< static data for ReportLevels() @@ -112,7 +116,7 @@ template Log::~Log() template bool& Log::ReportLevels() { -#ifndef WIN32 // see kludge note below +#ifndef USEKLUDGE // see kludge note below static bool dumpLevels = false; #endif return dumpLevels; @@ -120,7 +124,7 @@ template bool& Log::ReportLevels() template bool& Log::ReportTimeTags() { -#ifndef WIN32 // see kludge note below +#ifndef USEKLUDGE // see kludge note below static bool dumpTimeTags = false; #endif return dumpTimeTags; @@ -128,7 +132,7 @@ template bool& Log::ReportTimeTags() template LogLevel& Log::ReportingLevel() { -#ifndef WIN32 // see kludge note below +#ifndef USEKLUDGE // see kludge note below static LogLevel reportingLevel = INFO; // FILELOG_MAX_LEVEL; #endif return reportingLevel; @@ -317,7 +321,7 @@ class ConfigureLOG : public Log { // include file means that it occurs more than once - in every module in which it // appears. However Windows allows this; hence I have commented out the inner macro // here. Ah, the joys of developing under MS.... -#ifdef WIN32 +#ifdef USEKLUDGE //#ifndef LOGSTREAM_INITIALIZE_REPORTING_LEVEL //#define LOGSTREAM_INITIALIZE_REPORTING_LEVEL template<> LogLevel Log::reportingLevel = INFO;