From a20d7898f3794d3a05a33f77542c237651346f80 Mon Sep 17 00:00:00 2001 From: Benjamin Drung Date: Mon, 16 May 2016 12:44:00 +0200 Subject: [PATCH] Fix redeclaration of isinf() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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(). --- src/effects/Contrast.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/effects/Contrast.cpp b/src/effects/Contrast.cpp index 9227f5784..99f40b6f8 100644 --- a/src/effects/Contrast.cpp +++ b/src/effects/Contrast.cpp @@ -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));