X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2064113c9d9f81acb851b974a21a5f9170dfe9e2..44c87b7d15d5c1f5926beffa4cd5c9d1d2045e04:/include/wx/log.h?ds=inline diff --git a/include/wx/log.h b/include/wx/log.h index adab3ceb5b..83ea99678e 100644 --- a/include/wx/log.h +++ b/include/wx/log.h @@ -51,9 +51,11 @@ typedef unsigned long wxLogLevel; #include "wx/arrstr.h" +#ifndef __WXPALMOS5__ #ifndef __WXWINCE__ #include // for time_t #endif +#endif // ! __WXPALMOS5__ #include "wx/dynarray.h" @@ -196,8 +198,7 @@ public: static void SetTraceMask(wxTraceMask ulMask) { ms_ulTraceMask = ulMask; } // add string trace mask - static void AddTraceMask(const wxString& str) - { ms_aTraceMasks.push_back(str); } + static void AddTraceMask(const wxString& str); // add string trace mask static void RemoveTraceMask(const wxString& str); @@ -205,8 +206,9 @@ public: // remove all string trace masks static void ClearTraceMasks(); - // get string trace masks - static const wxArrayString &GetTraceMasks() { return ms_aTraceMasks; } + // get string trace masks: note that this is MT-unsafe if other threads can + // call AddTraceMask() concurrently + static const wxArrayString& GetTraceMasks() { return ms_aTraceMasks; } // sets the time stamp string format: this is used as strftime() format // string for the log targets which add time stamps to the messages; set @@ -302,10 +304,15 @@ protected: #endif // log a message indicating the number of times the previous message was - // repeated; only does something if ms_prevCounter > 0 - static void LogLastRepetitionCountIfNeeded(); + // repeated if ms_prevCounter > 0, does nothing otherwise; return the old + // value of ms_prevCounter + unsigned LogLastRepeatIfNeeded(); private: + // implement of LogLastRepeatIfNeeded(): it assumes that the + // caller had already locked ms_prevCS + unsigned LogLastRepeatIfNeededUnlocked(); + // static variables // ---------------- @@ -744,7 +751,14 @@ DECLARE_LOG_FUNCTION2(SysError, unsigned long, lErrCode); // empty functions if their parameters are complicated enough, but by // defining them as an empty inline function we ensure that even dumbest // compilers optimise them away +#ifdef __BORLANDC__ + // but Borland gives "W8019: Code has no effect" for wxLogNop() so we need + // to define it differently for it to avoid these warnings (same problem as + // with wxUnusedVar()) + #define wxLogNop() { } +#else inline void wxLogNop() { } +#endif #define wxVLogDebug(fmt, valist) wxLogNop() #define wxVLogTrace(mask, fmt, valist) wxLogNop()