From bb221d876e4a238103549bfd8d4b7587143585e8 Mon Sep 17 00:00:00 2001 From: weidai Date: Sat, 3 Sep 2005 15:32:12 +0000 Subject: 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 --- hrtimer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'hrtimer.cpp') 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() -- cgit v1.2.1