summaryrefslogtreecommitdiffstats
path: root/src/sql
diff options
context:
space:
mode:
authorBill King <bking@trolltech.com>2009-07-08 01:09:42 (GMT)
committerBill King <bking@trolltech.com>2009-07-08 01:12:15 (GMT)
commit5ff22b1ed4da11dc16a236825c939b5ae38d27cc (patch)
tree2682dd194b71332ac38c2f72597fc78fee8b3452 /src/sql
parent355d058a0c7eba3ae3b2a54dda566d94a4134941 (diff)
downloadQt-5ff22b1ed4da11dc16a236825c939b5ae38d27cc.zip
Qt-5ff22b1ed4da11dc16a236825c939b5ae38d27cc.tar.gz
Qt-5ff22b1ed4da11dc16a236825c939b5ae38d27cc.tar.bz2
Fixes Dericks inf/nan patch for msvc
Diffstat (limited to 'src/sql')
-rw-r--r--src/sql/drivers/psql/qsql_psql.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/sql/drivers/psql/qsql_psql.cpp b/src/sql/drivers/psql/qsql_psql.cpp
index 8de79a3..33f2e2b 100644
--- a/src/sql/drivers/psql/qsql_psql.cpp
+++ b/src/sql/drivers/psql/qsql_psql.cpp
@@ -59,7 +59,20 @@
#include <pg_config.h>
#include <stdlib.h>
+#if defined(_MSC_VER)
+#include <float.h>
+#define isnan(x) _isnan(x)
+int isinf(double x)
+{
+ if(_fpclass(x) == _FPCLASS_NINF)
+ return -1;
+ else if(_fpclass(x) == _FPCLASS_PINF)
+ return 1;
+ else return 0;
+}
+#else
#include <math.h>
+#endif
// workaround for postgres defining their OIDs in a private header file
#define QBOOLOID 16