From e4f3d088815b7f08650eec915da97acacf565d21 Mon Sep 17 00:00:00 2001 From: Gary Buhrmaster Date: Thu, 5 Jul 2012 01:52:38 -0700 Subject: [PATCH] use qIsNaN in place of ::isnan Feature patch for g++ C++0x/C++11 standards compliance When compiling with g++ and specifing -std=c++0x the compilation fails in mythplayer.cpp due to a namespace collision for isnan (std:: and math::). Patch attached which changes mythplayer to use the Qt function qIsNaN, providing a platform neutral implementation now that Qt has made that function available (in Qt 4.6). Since MythTV does not currently specify use of the new C++ standards, this patch is not necessary at this time, but may useful be at some future date (when gcc defaults to the C++11 standards?) Fixes #10524 Signed-off-by: Gavin Hurlbut --- mythtv/libs/libmythtv/mythplayer.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/mythtv/libs/libmythtv/mythplayer.cpp b/mythtv/libs/libmythtv/mythplayer.cpp index 5a637f727e6..b7ddf84abc4 100644 --- a/mythtv/libs/libmythtv/mythplayer.cpp +++ b/mythtv/libs/libmythtv/mythplayer.cpp @@ -8,7 +8,6 @@ #include #include #include -#include // POSIX headers #include @@ -26,6 +25,7 @@ using namespace std; #include #include #include +#include // MythTV headers #include "mthread.h" @@ -76,12 +76,6 @@ extern "C" { #define round(x) ((int) ((x) + 0.5)) #endif -#if CONFIG_DARWIN -extern "C" { -int isnan(double); -} -#endif - static unsigned dbg_ident(const MythPlayer*); #define LOC QString("Player(%1): ").arg(dbg_ident(this),0,36) @@ -811,7 +805,7 @@ void MythPlayer::SetScanType(FrameScanType scan) void MythPlayer::SetVideoParams(int width, int height, double fps, FrameScanType scan) { - if (width < 1 || height < 1 || isnan(fps)) + if (width < 1 || height < 1 || qIsNaN(fps)) return; video_dim = QSize((width + 15) & ~0xf, (height + 15) & ~0xf);