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-9d2fd5bffc1fpull/1/head
parent
28008debf7
commit
45fca4b005
|
@ -64,8 +64,10 @@ namespace Assimp {
|
||||||
NullLogger DefaultLogger::s_pNullLogger;
|
NullLogger DefaultLogger::s_pNullLogger;
|
||||||
Logger *DefaultLogger::m_pLogger = &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
|
struct LogStreamInfo
|
||||||
{
|
{
|
||||||
unsigned int m_uiErrorSeverity;
|
unsigned int m_uiErrorSeverity;
|
||||||
|
@ -252,7 +254,7 @@ void DefaultLogger::OnDebug( const char* message )
|
||||||
char msg[MAX_LOG_MESSAGE_LENGTH*2];
|
char msg[MAX_LOG_MESSAGE_LENGTH*2];
|
||||||
::sprintf(msg,"Debug, T%i: %s", GetThreadID(), message );
|
::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];
|
char msg[MAX_LOG_MESSAGE_LENGTH*2];
|
||||||
::sprintf(msg,"Info, T%i: %s", GetThreadID(), message );
|
::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];
|
char msg[MAX_LOG_MESSAGE_LENGTH*2];
|
||||||
::sprintf(msg,"Warn, T%i: %s", GetThreadID(), message );
|
::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];
|
char msg[MAX_LOG_MESSAGE_LENGTH*2];
|
||||||
::sprintf(msg,"Error, T%i: %s", GetThreadID(), message );
|
::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 )
|
bool DefaultLogger::attachStream( LogStream *pStream, unsigned int severity )
|
||||||
{
|
{
|
||||||
if (!pStream)
|
if (!pStream)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (0 == severity) {
|
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();
|
for ( StreamIt it = m_StreamArray.begin();
|
||||||
|
@ -320,7 +322,7 @@ bool DefaultLogger::detatchStream( LogStream *pStream, unsigned int severity )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (0 == severity) {
|
if (0 == severity) {
|
||||||
severity = Logger::INFO | Logger::ERR | Logger::WARN | Logger::DEBUGGING;
|
severity = SeverityAll;
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( StreamIt it = m_StreamArray.begin();
|
for ( StreamIt it = m_StreamArray.begin();
|
||||||
|
|
|
@ -80,10 +80,10 @@ public:
|
||||||
*/
|
*/
|
||||||
enum ErrorSeverity
|
enum ErrorSeverity
|
||||||
{
|
{
|
||||||
DEBUGGING = 1, //!< Debug log message
|
Debugging = 1, //!< Debug log message
|
||||||
INFO = 2, //!< Info log message
|
Info = 2, //!< Info log message
|
||||||
WARN = 4, //!< Warn log message
|
Warn = 4, //!< Warn log message
|
||||||
ERR = 8 //!< Error log message
|
Err = 8 //!< Error log message
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -121,31 +121,31 @@ public:
|
||||||
LogSeverity getLogSeverity() const;
|
LogSeverity getLogSeverity() const;
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
/** @brief Attach a new logstream
|
/** @brief Attach a new log-stream
|
||||||
*
|
*
|
||||||
* The logger takes ownership of the stream and is responsible
|
* The logger takes ownership of the stream and is responsible
|
||||||
* for its destruction (which is done using ::delete when the logger
|
* for its destruction (which is done using ::delete when the logger
|
||||||
* itself is destroyed). Call detachStream to detach a stream and to
|
* itself is destroyed). Call detachStream to detach a stream and to
|
||||||
* gain ownership of it again.
|
* 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
|
* @param severity Message filter, specified which types of log
|
||||||
* messages are dispatched to the stream. Provide a bitwise
|
* messages are dispatched to the stream. Provide a bitwise
|
||||||
* combination of the ErrorSeverity flags.
|
* combination of the ErrorSeverity flags.
|
||||||
* @return true if the stream has been attached, false otherwise.*/
|
* @return true if the stream has been attached, false otherwise.*/
|
||||||
virtual bool attachStream(LogStream *pStream,
|
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
|
/** @brief Detach a still attached stream from the logger (or
|
||||||
* modify the filter flags bits)
|
* 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
|
* @param severity Provide a bitwise combination of the ErrorSeverity
|
||||||
* flags. This value is &~ed with the current flags of the stream,
|
* 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
|
* if the result is 0 the stream is detached from the Logger and
|
||||||
* the caller retakes the possession of the stream.
|
* 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,
|
virtual bool detatchStream(LogStream *pStream,
|
||||||
unsigned int severity = DEBUGGING | ERR | WARN | INFO) = 0;
|
unsigned int severity = Debugging | Err | Warn | Info) = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -158,7 +158,7 @@ protected:
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
/** @brief Called as a request to write a specific debug message
|
/** @brief Called as a request to write a specific debug message
|
||||||
* @param message Debug message. Never longer than
|
* @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
|
* @note The message string is only valid until the scope of
|
||||||
* the function is left.
|
* the function is left.
|
||||||
*/
|
*/
|
||||||
|
@ -167,7 +167,7 @@ protected:
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
/** @brief Called as a request to write a specific info message
|
/** @brief Called as a request to write a specific info message
|
||||||
* @param message Info message. Never longer than
|
* @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
|
* @note The message string is only valid until the scope of
|
||||||
* the function is left.
|
* the function is left.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -2244,13 +2244,13 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
|
||||||
// ensure we get high priority
|
// ensure we get high priority
|
||||||
::SetPriorityClass(GetCurrentProcess(),HIGH_PRIORITY_CLASS);
|
::SetPriorityClass(GetCurrentProcess(),HIGH_PRIORITY_CLASS);
|
||||||
|
|
||||||
// initialise the default logger if neccessary
|
// initialize the default logger if necessary
|
||||||
Assimp::DefaultLogger::create("",Assimp::Logger::VERBOSE);
|
Assimp::DefaultLogger::create("",Assimp::Logger::VERBOSE);
|
||||||
|
|
||||||
CLogWindow::Instance().pcStream = new CMyLogStream();
|
CLogWindow::Instance().pcStream = new CMyLogStream();
|
||||||
Assimp::DefaultLogger::get()->attachStream(CLogWindow::Instance().pcStream,
|
Assimp::DefaultLogger::get()->attachStream(CLogWindow::Instance().pcStream,
|
||||||
Assimp::DefaultLogger::DEBUGGING | Assimp::DefaultLogger::INFO |
|
Assimp::DefaultLogger::Debugging | Assimp::DefaultLogger::Info |
|
||||||
Assimp::DefaultLogger::ERR | Assimp::DefaultLogger::WARN);
|
Assimp::DefaultLogger::Err | Assimp::DefaultLogger::Warn);
|
||||||
|
|
||||||
if (NULL == hDlg)
|
if (NULL == hDlg)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue