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
+2 -2
View File
@@ -22,11 +22,11 @@
#include "Clamp.hxx"
#include "Traits.hxx"
#include "util/Clamp.hxx"
#include "util/Math.hxx"
#include "Dither.cxx" // including the .cxx file to get inlined templates
#include <cassert>
#include <cmath>
template<SampleFormat F, class Traits=SampleTraits<F>>
static typename Traits::value_type
@@ -224,7 +224,7 @@ pcm_mix(PcmDither &dither, void *buffer1, const void *buffer2, size_t size,
s = sin(M_PI_2 * portion1);
s *= s;
int vol1 = std::lround(s * PCM_VOLUME_1S);
int vol1 = lround(s * PCM_VOLUME_1S);
vol1 = Clamp<int>(vol1, 0, PCM_VOLUME_1S);
return pcm_add_vol(dither, buffer1, buffer2, size,