From 9002b024693a8ac749a4d5f0b64821b2a1e8eab9 Mon Sep 17 00:00:00 2001 From: Eric Frias Date: Tue, 17 Jun 2014 15:45:16 -0400 Subject: [PATCH] Fix ambiguous abs() call in get_approximate_relative_time_string() --- src/time.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/time.cpp b/src/time.cpp index 9151aa6..2b40f95 100644 --- a/src/time.cpp +++ b/src/time.cpp @@ -49,10 +49,13 @@ namespace fc { string ago = default_ago; - if (event_time > relative_to_time) + int32_t seconds_ago = relative_to_time.sec_since_epoch() - event_time.sec_since_epoch(); + if (seconds_ago < 0) + { ago = " in the future"; + seconds_ago = -seconds_ago; + } stringstream result; - uint32_t seconds_ago = abs(relative_to_time.sec_since_epoch() - event_time.sec_since_epoch()); if (seconds_ago < 90) { result << seconds_ago << " second" << (seconds_ago > 1 ? "s" : "") << ago;