1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-25 08:38:39 +02:00

Fix redeclaration of isinf()

Commit 9e78a41 declared isinf() as std::isinf(), because isinf() was not
declared on Ubuntu 16.04. But now the builds fail on Ubuntu <= 15.10,
because isinf() is declared there:

effects/Contrast.cpp:61:12: error: ‘constexpr bool std::isinf(double)’ conflicts with a previous declaration
 using std::isinf;
            ^
In file included from /usr/include/features.h:364:0,
                 from /usr/include/assert.h:35,
                 from /usr/include/wx-3.0/wx/debug.h:14,
                 from /usr/include/wx-3.0/wx/defs.h:695,
                 from /usr/include/wx-3.0/wx/event.h:14,
                 from /usr/include/wx-3.0/wx/window.h:18,
                 from /usr/include/wx-3.0/wx/nonownedwnd.h:14,
                 from /usr/include/wx-3.0/wx/toplevel.h:20,
                 from /usr/include/wx-3.0/wx/dialog.h:14,
                 from effects/Contrast.h:12,
                 from effects/Contrast.cpp:13:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:201:1: note: previous declaration ‘int isinf(double)’
 __MATHDECL_1 (int,isinf,, (_Mdouble_ __value)) __attribute__ ((__const__));

Thus use std::isinf() directly instead of declaring isinf() as
std::isinf().
This commit is contained in:
Benjamin Drung 2016-05-16 12:44:00 +02:00
parent a4b98d4997
commit a20d7898f3

View File

@ -58,8 +58,6 @@
#define DB_MAX_LIMIT 0.0 // TODO: We should probably fail WCAG2 if audio is massively distorted.
#define WCAG2_PASS 20.0 // dB difference required to pass WCAG2 test.
using std::isinf;
bool ContrastDialog::GetDB(float &dB)
{
float rms = float(0.0);
@ -423,7 +421,7 @@ void ContrastDialog::results()
// TODO: We check for absolute silence here, so should not need to check again later in ::results()
if (mForegroundIsDefined) {
mForegroundRMSText->SetName(_("Measured foreground level")); // Read by screen-readers
if(isinf(- foregrounddB))
if(std::isinf(- foregrounddB))
mForegroundRMSText->ChangeValue(wxString::Format(_("zero")));
else
mForegroundRMSText->ChangeValue(wxString::Format(_("%.1f dB"), foregrounddB)); // i18n-hint: short form of 'decibels'
@ -435,7 +433,7 @@ void ContrastDialog::results()
if (mBackgroundIsDefined) {
mBackgroundRMSText->SetName(_("Measured background level"));
if(isinf(- backgrounddB))
if(std::isinf(- backgrounddB))
mBackgroundRMSText->ChangeValue(wxString::Format(_("zero")));
else
mBackgroundRMSText->ChangeValue(wxString::Format(_("%.1f dB"), backgrounddB));