From 45fca4b005a8ff3c83cd6b9a51a79b838475af62 Mon Sep 17 00:00:00 2001 From: kimmi Date: Sun, 23 Jan 2011 22:49:02 +0000 Subject: [PATCH] BUGFIX : Fix compile error on SunOS xentros 5.11: symbol conflict. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@896 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/DefaultLogger.cpp | 18 ++++++++++-------- include/Logger.h | 24 ++++++++++++------------ tools/assimp_view/MessageProc.cpp | 6 +++--- 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/code/DefaultLogger.cpp b/code/DefaultLogger.cpp index c8b9ecf35..e859e108d 100644 --- a/code/DefaultLogger.cpp +++ b/code/DefaultLogger.cpp @@ -64,8 +64,10 @@ namespace Assimp { NullLogger DefaultLogger::s_pNullLogger; Logger *DefaultLogger::m_pLogger = &DefaultLogger::s_pNullLogger; +static const unsigned int SeverityAll = Logger::Info | Logger::Err | Logger::Warn | Logger::Debugging; + // ---------------------------------------------------------------------------------- -// Represents a logstream + its error severity +// Represents a log-stream + its error severity struct LogStreamInfo { unsigned int m_uiErrorSeverity; @@ -252,7 +254,7 @@ void DefaultLogger::OnDebug( const char* message ) char msg[MAX_LOG_MESSAGE_LENGTH*2]; ::sprintf(msg,"Debug, T%i: %s", GetThreadID(), message ); - WriteToStreams( msg, Logger::DEBUGGING ); + WriteToStreams( msg, Logger::Debugging ); } // ---------------------------------------------------------------------------------- @@ -262,7 +264,7 @@ void DefaultLogger::OnInfo( const char* message ) char msg[MAX_LOG_MESSAGE_LENGTH*2]; ::sprintf(msg,"Info, T%i: %s", GetThreadID(), message ); - WriteToStreams( msg , Logger::INFO ); + WriteToStreams( msg , Logger::Info ); } // ---------------------------------------------------------------------------------- @@ -272,7 +274,7 @@ void DefaultLogger::OnWarn( const char* message ) char msg[MAX_LOG_MESSAGE_LENGTH*2]; ::sprintf(msg,"Warn, T%i: %s", GetThreadID(), message ); - WriteToStreams( msg, Logger::WARN ); + WriteToStreams( msg, Logger::Warn ); } // ---------------------------------------------------------------------------------- @@ -282,18 +284,18 @@ void DefaultLogger::OnError( const char* message ) char msg[MAX_LOG_MESSAGE_LENGTH*2]; ::sprintf(msg,"Error, T%i: %s", GetThreadID(), message ); - WriteToStreams( msg, Logger::ERR ); + WriteToStreams( msg, Logger::Err ); } // ---------------------------------------------------------------------------------- -// Attachs a new stream +// Will attach a new stream bool DefaultLogger::attachStream( LogStream *pStream, unsigned int severity ) { if (!pStream) return false; if (0 == severity) { - severity = Logger::INFO | Logger::ERR | Logger::WARN | Logger::DEBUGGING; + severity = Logger::Info | Logger::Err | Logger::Warn | Logger::Debugging; } for ( StreamIt it = m_StreamArray.begin(); @@ -320,7 +322,7 @@ bool DefaultLogger::detatchStream( LogStream *pStream, unsigned int severity ) return false; if (0 == severity) { - severity = Logger::INFO | Logger::ERR | Logger::WARN | Logger::DEBUGGING; + severity = SeverityAll; } for ( StreamIt it = m_StreamArray.begin(); diff --git a/include/Logger.h b/include/Logger.h index 5323a351f..b11e52e9a 100644 --- a/include/Logger.h +++ b/include/Logger.h @@ -80,10 +80,10 @@ public: */ enum ErrorSeverity { - DEBUGGING = 1, //!< Debug log message - INFO = 2, //!< Info log message - WARN = 4, //!< Warn log message - ERR = 8 //!< Error log message + Debugging = 1, //!< Debug log message + Info = 2, //!< Info log message + Warn = 4, //!< Warn log message + Err = 8 //!< Error log message }; public: @@ -121,31 +121,31 @@ public: LogSeverity getLogSeverity() const; // ---------------------------------------------------------------------- - /** @brief Attach a new logstream + /** @brief Attach a new log-stream * * The logger takes ownership of the stream and is responsible * for its destruction (which is done using ::delete when the logger * itself is destroyed). Call detachStream to detach a stream and to * gain ownership of it again. - * @param pStream Logstream to attach + * @param pStream Log-stream to attach * @param severity Message filter, specified which types of log * messages are dispatched to the stream. Provide a bitwise * combination of the ErrorSeverity flags. * @return true if the stream has been attached, false otherwise.*/ virtual bool attachStream(LogStream *pStream, - unsigned int severity = DEBUGGING | ERR | WARN | INFO) = 0; + unsigned int severity = Debugging | Err | Warn | Info) = 0; // ---------------------------------------------------------------------- /** @brief Detach a still attached stream from the logger (or * modify the filter flags bits) - * @param pStream Logstream instance for detaching + * @param pStream Log-stream instance for detaching * @param severity Provide a bitwise combination of the ErrorSeverity * flags. This value is &~ed with the current flags of the stream, * if the result is 0 the stream is detached from the Logger and * the caller retakes the possession of the stream. - * @return true if the stream has been dettached, false otherwise.*/ + * @return true if the stream has been detached, false otherwise.*/ virtual bool detatchStream(LogStream *pStream, - unsigned int severity = DEBUGGING | ERR | WARN | INFO) = 0; + unsigned int severity = Debugging | Err | Warn | Info) = 0; protected: @@ -158,7 +158,7 @@ protected: // ---------------------------------------------------------------------- /** @brief Called as a request to write a specific debug message * @param message Debug message. Never longer than - * MAX_LOG_MESSAGE_LENGTH characters (exluding the '0'). + * MAX_LOG_MESSAGE_LENGTH characters (excluding the '0'). * @note The message string is only valid until the scope of * the function is left. */ @@ -167,7 +167,7 @@ protected: // ---------------------------------------------------------------------- /** @brief Called as a request to write a specific info message * @param message Info message. Never longer than - * MAX_LOG_MESSAGE_LENGTH characters (exluding the '0'). + * MAX_LOG_MESSAGE_LENGTH characters (ecxluding the '0'). * @note The message string is only valid until the scope of * the function is left. */ diff --git a/tools/assimp_view/MessageProc.cpp b/tools/assimp_view/MessageProc.cpp index 766dfbb4b..70216e4dc 100644 --- a/tools/assimp_view/MessageProc.cpp +++ b/tools/assimp_view/MessageProc.cpp @@ -2244,13 +2244,13 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, // ensure we get high priority ::SetPriorityClass(GetCurrentProcess(),HIGH_PRIORITY_CLASS); - // initialise the default logger if neccessary + // initialize the default logger if necessary Assimp::DefaultLogger::create("",Assimp::Logger::VERBOSE); CLogWindow::Instance().pcStream = new CMyLogStream(); Assimp::DefaultLogger::get()->attachStream(CLogWindow::Instance().pcStream, - Assimp::DefaultLogger::DEBUGGING | Assimp::DefaultLogger::INFO | - Assimp::DefaultLogger::ERR | Assimp::DefaultLogger::WARN); + Assimp::DefaultLogger::Debugging | Assimp::DefaultLogger::Info | + Assimp::DefaultLogger::Err | Assimp::DefaultLogger::Warn); if (NULL == hDlg) {