From cc6a67b76a09660b27fea50856f49cfdfe013da0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 8 Jul 2013 14:54:19 +0200 Subject: Add support for Visual Studio 2005 --- odb/boost/date-time/mysql/posix-time-traits.hxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'odb/boost/date-time') 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 (ms); } -- cgit v1.1