From a482c798ade19fa714a4c399ea4c65c18b6de6c8 Mon Sep 17 00:00:00 2001 From: John Regan Date: Wed, 24 May 2023 15:05:19 -0400 Subject: [PATCH] pcm: declare IsSilentSample as const GNU libstdc++ declares cmath functions as constexpr, but libc++ does not. The C++ standards state the standard library functions should not be declared constexpr unless explicitly required. --- src/pcm/ReplayGainAnalyzer.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pcm/ReplayGainAnalyzer.cxx b/src/pcm/ReplayGainAnalyzer.cxx index 86ba27067..5ec227923 100644 --- a/src/pcm/ReplayGainAnalyzer.cxx +++ b/src/pcm/ReplayGainAnalyzer.cxx @@ -86,7 +86,8 @@ CalcStereoRMS(std::span src) noexcept return 10 * std::log10(sum / src.size()) + 90.0 - 3.0; } -static constexpr bool +[[gnu::const]] +static bool IsSilentSample(float value) noexcept { return std::fabs(value) <= 1e-10f;