Tom Lane wrote:
> Yes, we should not be assuming that finite() is a macro, which is what
> that #ifdef coding does. We need a HAVE_FINITE configuration test.
> If you have time to prepare the diffs it'd be great.
Here they are
Christof
diff -ru /home/christof/pgsql-cvs/pgsql/src/backend/utils/adt/float.c pgsql/src/backend/utils/adt/float.c
--- /home/christof/pgsql-cvs/pgsql/src/backend/utils/adt/float.c Mon Sep 27 10:07:29 1999
+++ pgsql/src/backend/utils/adt/float.c Fri Oct 1 11:49:32 1999
@@ -1157,11 +1157,11 @@
tmp1 = *arg1;
tmp2 = *arg2;
-#ifndef finite
+#ifndef HAVE_FINITE
errno = 0;
#endif
*result = (float64data) pow(tmp1, tmp2);
-#ifndef finite
+#ifndef HAVE_FINITE
if (errno != 0) /* on some machines both EDOM & ERANGE can
* occur */
#else
@@ -1189,11 +1189,11 @@
result = (float64) palloc(sizeof(float64data));
tmp = *arg1;
-#ifndef finite
+#ifndef HAVE_FINITE
errno = 0;
#endif
*result = (float64data) exp(tmp);
-#ifndef finite
+#ifndef HAVE_FINITE
if (errno == ERANGE)
#else
/* infinity implies overflow, zero implies underflow */
diff -ru /home/christof/pgsql-cvs/pgsql/src/configure.in pgsql/src/configure.in
--- /home/christof/pgsql-cvs/pgsql/src/configure.in Mon Sep 13 08:44:37 1999
+++ pgsql/src/configure.in Fri Oct 1 11:39:25 1999
@@ -769,6 +769,12 @@
AC_DEFINE(HAVE_RINT),
AC_CHECK_LIB(m, rint, AC_DEFINE(HAVE_RINT), , $HPUXMATHLIB))
+AC_MSG_CHECKING(for finite() macro or function)
+AC_TRY_LINK([#include <math.h>],
+ [int dummy=finite(1.0);],
+ [AC_DEFINE(HAVE_FINITE) AC_MSG_RESULT(yes)],
+ AC_MSG_RESULT(no))
+
dnl Check to see if we have a working 64-bit integer type.
dnl This breaks down into two steps:
dnl (1) figure out if the compiler has a 64-bit int type with working
diff -ru /home/christof/pgsql-cvs/pgsql/src/include/config.h.in pgsql/src/include/config.h.in
--- /home/christof/pgsql-cvs/pgsql/src/include/config.h.in Mon Sep 13 08:44:38 1999
+++ pgsql/src/include/config.h.in Fri Oct 1 11:46:23 1999
@@ -359,6 +359,9 @@
/* Set to 1 if you have rint() */
#undef HAVE_RINT
+/* Set to 1 if you have finite() */
+#undef HAVE_FINITE
+
/* Set to 1 if you have memmove() */
#undef HAVE_MEMMOVE