diff options
author | Chris Wilson <chris+github@qwirx.com> | 2007-03-10 16:53:56 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2007-03-10 16:53:56 +0000 |
commit | 23d8a877503763ce761a502bf7f0e79a2f5f07f5 (patch) | |
tree | 269fb1f9ecd3277c629db5da9cc0de71d211f172 /lib | |
parent | 88f1bb6bff3e12118d945e614992ab38f65ddd0d (diff) |
Win32 compile fixes (no gettimeofday(), no signal()) (refs #3)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/common/Timer.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/common/Timer.cpp b/lib/common/Timer.cpp index add827f7..c24f38f9 100644 --- a/lib/common/Timer.cpp +++ b/lib/common/Timer.cpp @@ -144,10 +144,13 @@ void Timers::Reschedule() { THROW_EXCEPTION(CommonException, Internal) } + + #ifndef WIN32 if (::signal(SIGALRM, Timers::SignalHandler) != Timers::SignalHandler) { THROW_EXCEPTION(CommonException, Internal) } + #endif // Clear the reschedule-needed flag to false before we start. // If a timer event occurs while we are scheduling, then we @@ -255,7 +258,7 @@ Timer::Timer(size_t timeoutSecs) : mExpires(GetCurrentBoxTime() + SecondsToBoxTime(timeoutSecs)), mExpired(false) { - #ifndef NDEBUG + #if !defined NDEBUG && !defined WIN32 struct timeval tv; gettimeofday(&tv, NULL); if (timeoutSecs == 0) @@ -285,7 +288,7 @@ Timer::Timer(size_t timeoutSecs) Timer::~Timer() { - #ifndef NDEBUG + #if !defined NDEBUG && !defined WIN32 struct timeval tv; gettimeofday(&tv, NULL); TRACE3("%d.%d: timer %p destroyed, will not fire\n", @@ -299,7 +302,7 @@ Timer::Timer(const Timer& rToCopy) : mExpires(rToCopy.mExpires), mExpired(rToCopy.mExpired) { - #ifndef NDEBUG + #if !defined NDEBUG && !defined WIN32 struct timeval tv; gettimeofday(&tv, NULL); if (mExpired) @@ -331,7 +334,7 @@ Timer::Timer(const Timer& rToCopy) Timer& Timer::operator=(const Timer& rToCopy) { - #ifndef NDEBUG + #if !defined NDEBUG && !defined WIN32 struct timeval tv; gettimeofday(&tv, NULL); if (rToCopy.mExpired) @@ -367,7 +370,7 @@ Timer& Timer::operator=(const Timer& rToCopy) void Timer::OnExpire() { - #ifndef NDEBUG + #if !defined NDEBUG && !defined WIN32 struct timeval tv; gettimeofday(&tv, NULL); TRACE3("%d.%d: timer %p fired\n", tv.tv_sec, tv.tv_usec, this); |