Skip to content

Commit

Permalink
A speculative fix for some compilation problems as a result of commit
Browse files Browse the repository at this point in the history
r5887. May need more tweaking...


git-svn-id: http://svn.osgeo.org/qgis/trunk@5890 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Sep 30, 2006
1 parent 80084da commit b906049
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
11 changes: 11 additions & 0 deletions configure.in
Expand Up @@ -100,6 +100,17 @@ dnl GDAL/OGR
dnl ---------------------------------------------------------------------------
AQ_CHECK_GDAL

dnl ---------------------------------------------------------------------------
dnl Whether to use isfinite or std::isfinite
dnl ---------------------------------------------------------------------------
have_stdisfinite=no
AC_MSG_CHECKING([[<cmath> for std::isfinite]])
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[#include <cmath>]], [[ std::isfinite(0) ]]),
[[have_stdisfinite=yes]
AC_DEFINE(HAVE_STDISFINITE,1,[Define to 1 if std::isfinite is available])
], [])
AC_MSG_RESULT([[$have_stdisfinite]])

dnl ---------------------------------------------------------------------------
dnl GEOS
dnl ---------------------------------------------------------------------------
Expand Down
21 changes: 12 additions & 9 deletions src/providers/wms/qgswmsprovider.cpp
Expand Up @@ -18,9 +18,13 @@

/* $Id$ */

#define _GLIBCPP_USE_C99 1
#include <cmath>
#undef _GLIBCPP_USE_C99
#include "qgsconfig.h"

#ifdef HAVE_STDISFINITE
#include <cmath>
#else
#include <math.h>
#endif

#include "qgslogger.h"
#include "qgswmsprovider.h"
Expand All @@ -33,8 +37,7 @@

#include "qgshttptransaction.h"

#include <q3url.h>
#include <Q3Picture>
#include <Q3Url>


#ifdef QGISDEBUG
Expand Down Expand Up @@ -1951,12 +1954,12 @@ bool QgsWmsProvider::calculateExtent()
}

//make sure extent does not contain 'inf' or 'nan'
#if __GNUC__ >= 4
if(!isfinite(extent.xMin()) || !isfinite((int)extent.yMin()) || !isfinite(extent.xMax()) || \
!isfinite((int)extent.yMax()))
#else
#ifdef HAVE_STDISFINITE
if(!std::isfinite(extent.xMin()) || !std::isfinite((int)extent.yMin()) || !std::isfinite(extent.xMax()) || \
!std::isfinite((int)extent.yMax()))
#else
if(!isfinite(extent.xMin()) || !isfinite((int)extent.yMin()) || !isfinite(extent.xMax()) || \
!isfinite((int)extent.yMax()))
#endif
{
continue;
Expand Down

0 comments on commit b906049

Please sign in to comment.