diff options
Diffstat (limited to 'ACE/ace/Log_Msg.cpp')
-rw-r--r-- | ACE/ace/Log_Msg.cpp | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/ACE/ace/Log_Msg.cpp b/ACE/ace/Log_Msg.cpp index 60a034399d2..9e3f3949e52 100644 --- a/ACE/ace/Log_Msg.cpp +++ b/ACE/ace/Log_Msg.cpp @@ -19,7 +19,7 @@ #include "ace/os_include/os_typeinfo.h" #if !defined (ACE_MT_SAFE) || (ACE_MT_SAFE != 0) -# include "ace/Object_Manager_Base.h" +# include "ace/Object_Manager.h" #endif /* ! ACE_MT_SAFE */ #if !defined (ACE_LACKS_IOSTREAM_TOTALLY) @@ -999,7 +999,7 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, #else // External decls. - typedef void (*PTF)(...); + typedef void (*PointerToFunction)(...); // Check if there were any conditional values set. bool const conditional_values = this->conditional_values_.is_set_; @@ -1671,7 +1671,7 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, } ACE_Log_Msg::msg_off_ = bp - this->msg_; - (*va_arg (argp, PTF))(); + (*va_arg (argp, PointerToFunction))(); if (ACE_BIT_ENABLED (flags, ACE_Log_Msg::SILENT) && @@ -1790,16 +1790,27 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, ACE_OS::sprintf (bp, format, static_cast <unsigned> (ACE_Thread::self ())); -#elif defined ACE_USES_WCHAR +#else + +# ifdef ACE_HAS_GETTID +# define ACE_LOG_MSG_GET_THREAD_ID ACE_OS::thr_gettid +# define ACE_LOG_MSG_GET_THREAD_ID_BUFFER_SIZE 8 +# else +# define ACE_LOG_MSG_GET_THREAD_ID ACE_OS::thr_id +# define ACE_LOG_MSG_GET_THREAD_ID_BUFFER_SIZE 32 +# endif + +# if defined ACE_USES_WCHAR { - char tid_buf[32] = {}; - ACE_OS::thr_id (tid_buf, sizeof tid_buf); + char tid_buf[ACE_LOG_MSG_GET_THREAD_ID_BUFFER_SIZE] = {}; + ACE_LOG_MSG_GET_THREAD_ID (tid_buf, sizeof tid_buf); this_len = ACE_OS::strlen (tid_buf); ACE_OS::strncpy (bp, ACE_TEXT_CHAR_TO_TCHAR (tid_buf), bspace); } -#else - this_len = ACE_OS::thr_id (bp, bspace); +# else + this_len = ACE_LOG_MSG_GET_THREAD_ID (bp, bspace); +# endif /* ACE_USES_WCHAR */ #endif /* ACE_WIN32 */ ACE_UPDATE_COUNT (bspace, this_len); break; |