Skip to content

Commit b906049

Browse files
author
g_j_m
committedSep 30, 2006
A speculative fix for some compilation problems as a result of commit
r5887. May need more tweaking... git-svn-id: http://svn.osgeo.org/qgis/trunk@5890 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 80084da commit b906049

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed
 

‎configure.in‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,17 @@ dnl GDAL/OGR
100100
dnl ---------------------------------------------------------------------------
101101
AQ_CHECK_GDAL
102102

103+
dnl ---------------------------------------------------------------------------
104+
dnl Whether to use isfinite or std::isfinite
105+
dnl ---------------------------------------------------------------------------
106+
have_stdisfinite=no
107+
AC_MSG_CHECKING([[<cmath> for std::isfinite]])
108+
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[#include <cmath>]], [[ std::isfinite(0) ]]),
109+
[[have_stdisfinite=yes]
110+
AC_DEFINE(HAVE_STDISFINITE,1,[Define to 1 if std::isfinite is available])
111+
], [])
112+
AC_MSG_RESULT([[$have_stdisfinite]])
113+
103114
dnl ---------------------------------------------------------------------------
104115
dnl GEOS
105116
dnl ---------------------------------------------------------------------------

‎src/providers/wms/qgswmsprovider.cpp‎

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@
1818

1919
/* $Id$ */
2020

21-
#define _GLIBCPP_USE_C99 1
22-
#include <cmath>
23-
#undef _GLIBCPP_USE_C99
21+
#include "qgsconfig.h"
22+
23+
#ifdef HAVE_STDISFINITE
24+
#include <cmath>
25+
#else
26+
#include <math.h>
27+
#endif
2428

2529
#include "qgslogger.h"
2630
#include "qgswmsprovider.h"
@@ -33,8 +37,7 @@
3337

3438
#include "qgshttptransaction.h"
3539

36-
#include <q3url.h>
37-
#include <Q3Picture>
40+
#include <Q3Url>
3841

3942

4043
#ifdef QGISDEBUG
@@ -1951,12 +1954,12 @@ bool QgsWmsProvider::calculateExtent()
19511954
}
19521955

19531956
//make sure extent does not contain 'inf' or 'nan'
1954-
#if __GNUC__ >= 4
1955-
if(!isfinite(extent.xMin()) || !isfinite((int)extent.yMin()) || !isfinite(extent.xMax()) || \
1956-
!isfinite((int)extent.yMax()))
1957-
#else
1957+
#ifdef HAVE_STDISFINITE
19581958
if(!std::isfinite(extent.xMin()) || !std::isfinite((int)extent.yMin()) || !std::isfinite(extent.xMax()) || \
19591959
!std::isfinite((int)extent.yMax()))
1960+
#else
1961+
if(!isfinite(extent.xMin()) || !isfinite((int)extent.yMin()) || !isfinite(extent.xMax()) || \
1962+
!isfinite((int)extent.yMax()))
19601963
#endif
19611964
{
19621965
continue;

0 commit comments

Comments
 (0)
Please sign in to comment.