summaryrefslogtreecommitdiffstats
path: root/base/timer.h
diff options
context:
space:
mode:
Diffstat (limited to 'base/timer.h')
-rw-r--r--base/timer.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/base/timer.h b/base/timer.h
index 4374971..de22b64 100644
--- a/base/timer.h
+++ b/base/timer.h
@@ -31,7 +31,6 @@
#define BASE_TIMER_H_
#include <math.h>
-#include <windows.h>
#include <queue>
#include <vector>
@@ -39,6 +38,10 @@
#include "base/basictypes.h"
#include "base/time.h"
+#ifdef OS_WIN
+#include <windows.h>
+#endif // OS_WIN
+
// Timer/TimerManager are objects designed to help setting timers.
// Goals of TimerManager:
// - have only one Windows system timer for all app timer functionality
@@ -202,7 +205,7 @@ class TimerManager {
void set_use_broken_delay(bool use_broken_delay) {
use_broken_delay_ = use_broken_delay;
}
-#endif
+#endif // UNIT_TEST
protected:
// Peek at the timer which will fire soonest.
@@ -212,16 +215,18 @@ class TimerManager {
// Update our Windows WM_TIMER to match our most immediately pending timer.
void UpdateWindowsWmTimer();
+#ifdef OS_WIN
// Retrieve the Message Window that handles WM_TIMER messages from the
// system.
HWND GetMessageHWND();
+ HWND message_hwnd_;
+#endif // OS_WIN
+
TimerPQueue timers_;
bool use_broken_delay_;
- HWND message_hwnd_;
-
// Flag to enable/disable use of native timers.
bool use_native_timers_;