]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/log.h
Better fix
[wxWidgets.git] / include / wx / log.h
index a3cf858c4fa98be288b0c1693e29ef18ec11c228..4d9523604271ef8422f6d77a1c594350411e4b3e 100644 (file)
@@ -14,7 +14,9 @@
 
 #include "wx/defs.h"
 
 
 #include "wx/defs.h"
 
-#include "wx/thread.h"
+#if wxUSE_THREADS
+    class WXDLLIMPEXP_FWD_BASE wxCriticalSection;
+#endif
 
 // ----------------------------------------------------------------------------
 // common constants for use in wxUSE_LOG/!wxUSE_LOG
 
 // ----------------------------------------------------------------------------
 // common constants for use in wxUSE_LOG/!wxUSE_LOG
@@ -53,9 +55,11 @@ typedef unsigned long wxLogLevel;
 
 #include "wx/arrstr.h"
 
 
 #include "wx/arrstr.h"
 
+#ifndef __WXPALMOS5__
 #ifndef __WXWINCE__
     #include <time.h>   // for time_t
 #endif
 #ifndef __WXWINCE__
     #include <time.h>   // for time_t
 #endif
+#endif // ! __WXPALMOS5__
 
 #include "wx/dynarray.h"
 
 
 #include "wx/dynarray.h"
 
@@ -306,9 +310,13 @@ protected:
     // log a message indicating the number of times the previous message was
     // repeated if ms_prevCounter > 0, does nothing otherwise; return the old
     // value of ms_prevCounter
     // log a message indicating the number of times the previous message was
     // repeated if ms_prevCounter > 0, does nothing otherwise; return the old
     // value of ms_prevCounter
-    unsigned LogLastRepetitionCountIfNeeded();
+    unsigned LogLastRepeatIfNeeded();
 
 private:
 
 private:
+    // implement of LogLastRepeatIfNeeded(): it assumes that the
+    // caller had already locked ms_prevCS
+    unsigned LogLastRepeatIfNeededUnlocked();
+
     // static variables
     // ----------------
 
     // static variables
     // ----------------
 
@@ -316,7 +324,9 @@ private:
     // with the number of times it was repeated
     static bool        ms_bRepetCounting;
 
     // with the number of times it was repeated
     static bool        ms_bRepetCounting;
 
-    wxCRIT_SECT_DECLARE(ms_prevCS);     // protects the ms_prev values below
+#if wxUSE_THREADS
+    static wxCriticalSection ms_prevCS; // protects the ms_prev values below
+#endif
     static wxString    ms_prevString;   // previous message that was logged
     static unsigned    ms_prevCounter;  // how many times it was repeated
     static time_t      ms_prevTimeStamp;// timestamp of the previous message
     static wxString    ms_prevString;   // previous message that was logged
     static unsigned    ms_prevCounter;  // how many times it was repeated
     static time_t      ms_prevTimeStamp;// timestamp of the previous message