summaryrefslogtreecommitdiff
path: root/hrtimer.cpp
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2005-09-03 15:32:12 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2005-09-03 15:32:12 +0000
commitbb221d876e4a238103549bfd8d4b7587143585e8 (patch)
tree0f28755f291e0f68601410aac5fc6558c716728a /hrtimer.cpp
parentdb07db6c9df171686921ae5ba6748bf5971fb505 (diff)
downloadcryptopp-bb221d876e4a238103549bfd8d4b7587143585e8.tar.gz
fix compile with MSVC 6 without Processor Pack
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@207 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'hrtimer.cpp')
-rw-r--r--hrtimer.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/hrtimer.cpp b/hrtimer.cpp
index 38763fb..b29f745 100644
--- a/hrtimer.cpp
+++ b/hrtimer.cpp
@@ -23,7 +23,13 @@ double TimerBase::ConvertTo(word64 t, Unit unit)
static unsigned long unitsPerSecondTable[] = {1, 1000, 1000*1000, 1000*1000*1000};
assert(unit < sizeof(unitsPerSecondTable) / sizeof(unitsPerSecondTable[0]));
+#if defined(_MSC_VER) && (_MSC_VER < 1300)
+ // MSVC 6 workaround
+ return (double)(__int64)t * unitsPerSecondTable[unit] / (__int64)TicksPerSecond();
+#else
return (double)t * unitsPerSecondTable[unit] / TicksPerSecond();
+#endif
+
}
void TimerBase::StartTimer()