aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/ecpglib/data.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2010-02-27 21:53:21 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2010-02-27 21:53:21 +0000
commit4d17a2146ca7f48bca1da4c73a745fb09ec43ed3 (patch)
treecea3f7cd728afe3be857f4c98cbe0f8040fb936b /src/interfaces/ecpg/ecpglib/data.c
parentbf379837dcd7f0f080d61955ed630b023a3b392d (diff)
downloadpostgresql-4d17a2146ca7f48bca1da4c73a745fb09ec43ed3.tar.gz
postgresql-4d17a2146ca7f48bca1da4c73a745fb09ec43ed3.zip
Insert a hack into get_float8_nan (both core and ecpg copies) to deal with
the fact that NetBSD/mips is currently broken, as per buildfarm member pika. Also add regression tests to ensure that get_float8_nan and get_float4_nan are exercised even on platforms where they are not needed by float8in/float4in. Zoltán Böszörményi and Tom Lane
Diffstat (limited to 'src/interfaces/ecpg/ecpglib/data.c')
-rw-r--r--src/interfaces/ecpg/ecpglib/data.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/interfaces/ecpg/ecpglib/data.c b/src/interfaces/ecpg/ecpglib/data.c
index f5190049e12..5035dbd7053 100644
--- a/src/interfaces/ecpg/ecpglib/data.c
+++ b/src/interfaces/ecpg/ecpglib/data.c
@@ -1,10 +1,11 @@
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.50 2010/02/26 02:01:29 momjian Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.51 2010/02/27 21:53:21 tgl Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
#include <stdlib.h>
#include <string.h>
+#include <float.h>
#include <math.h>
#include "ecpgtype.h"
@@ -85,7 +86,8 @@ get_float8_infinity(void)
static double
get_float8_nan(void)
{
-#ifdef NAN
+ /* (double) NAN doesn't work on some NetBSD/MIPS releases */
+#if defined(NAN) && !(defined(__NetBSD__) && defined(__mips__))
return (double) NAN;
#else
return (double) (0.0 / 0.0);