treewide: use boost::lround when std::round is unavailable

This is the case with uClibc-ng currently.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2020-02-02 21:21:57 -08:00
parent b5d1a09010
commit 3ec9fcfc44
8 changed files with 52 additions and 13 deletions

View File

@@ -28,13 +28,13 @@
#include "db/Stats.hxx"
#include "Log.hxx"
#include "time/ChronoUtil.hxx"
#include "util/Math.hxx"
#ifdef _WIN32
#include "system/Clock.hxx"
#endif
#include <chrono>
#include <cmath>
#ifndef _WIN32
/**
@@ -126,7 +126,7 @@ stats_print(Response &r, const Partition &partition)
r.Format("uptime: %u\n"
"playtime: %lu\n",
(unsigned)std::chrono::duration_cast<std::chrono::seconds>(uptime).count(),
std::lround(partition.pc.GetTotalPlayTime().count()));
lround(partition.pc.GetTotalPlayTime().count()));
#ifdef ENABLE_DATABASE
const Database *db = partition.instance.GetDatabase();