Module: check_mk
Branch: master
Commit: c5f7f424e0a8fa2eb850478351a492afff78efe9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c5f7f424e0a8fa…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Fri Sep 8 09:52:45 2017 +0200
Make ChronoUtils.h a bit more cross-compiler-friendly.
Change-Id: I7ade92c1d2fc401af81a8e8b48628c1f3259ba22
---
livestatus/src/ChronoUtils.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/livestatus/src/ChronoUtils.h b/livestatus/src/ChronoUtils.h
index ca78ff8..da53b07 100644
--- a/livestatus/src/ChronoUtils.h
+++ b/livestatus/src/ChronoUtils.h
@@ -58,8 +58,9 @@ template <typename Rep, typename Period>
inline timeval to_timeval(std::chrono::duration<Rep, Period> dur) {
using namespace std::chrono;
timeval tv;
- tv.tv_sec = static_cast<time_t>(duration_cast<seconds>(dur).count());
- tv.tv_usec = static_cast<suseconds_t>(
+ tv.tv_sec =
+
static_cast<decltype(tv.tv_sec)>(duration_cast<seconds>(dur).count());
+ tv.tv_usec = static_cast<decltype(tv.tv_usec)>(
duration_cast<microseconds>(dur % seconds(1)).count());
return tv;
}