aboutsummaryrefslogtreecommitdiff
path: root/odb/boost/date-time
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-07-08 14:54:19 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-07-08 14:54:19 +0200
commitcc6a67b76a09660b27fea50856f49cfdfe013da0 (patch)
treeeedfb5777f965dd765028a1e2522ca2c46eda17e /odb/boost/date-time
parent2955140aaa1ac8892410c2dc7d37acde864cc76b (diff)
Add support for Visual Studio 2005
Diffstat (limited to 'odb/boost/date-time')
-rw-r--r--odb/boost/date-time/mysql/posix-time-traits.hxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/odb/boost/date-time/mysql/posix-time-traits.hxx b/odb/boost/date-time/mysql/posix-time-traits.hxx
index 2f40445..9750d12 100644
--- a/odb/boost/date-time/mysql/posix-time-traits.hxx
+++ b/odb/boost/date-time/mysql/posix-time-traits.hxx
@@ -210,7 +210,10 @@ namespace odb
i.minute = std::abs (v.minutes ());
i.second = std::abs (v.seconds ());
- unsigned long long ms (std::abs (v.fractional_seconds ()));
+ // Some compilers, e.g., VC8, don't have 64-bit abs() overload.
+ //
+ time_duration::fractional_seconds_type sms (v.fractional_seconds ());
+ unsigned long long ms (sms >= 0 ? sms : -sms);
ms = ms * 1000000ULL / time_duration::ticks_per_second ();
i.second_part = static_cast<unsigned long> (ms);
}