Commit 1f122a7c authored by Tom Lane's avatar Tom Lane

Replace float.c's #ifdef finite check with a proper autoconf check, so it

works if finite() is a function.  Patch from Christof Petig.
parent 54204e6c
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.49 1999/09/26 21:21:15 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.50 1999/10/02 17:45:31 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -1157,11 +1157,11 @@ dpow(float64 arg1, float64 arg2) ...@@ -1157,11 +1157,11 @@ dpow(float64 arg1, float64 arg2)
tmp1 = *arg1; tmp1 = *arg1;
tmp2 = *arg2; tmp2 = *arg2;
#ifndef finite #ifndef HAVE_FINITE
errno = 0; errno = 0;
#endif #endif
*result = (float64data) pow(tmp1, tmp2); *result = (float64data) pow(tmp1, tmp2);
#ifndef finite #ifndef HAVE_FINITE
if (errno != 0) /* on some machines both EDOM & ERANGE can if (errno != 0) /* on some machines both EDOM & ERANGE can
* occur */ * occur */
#else #else
...@@ -1189,11 +1189,11 @@ dexp(float64 arg1) ...@@ -1189,11 +1189,11 @@ dexp(float64 arg1)
result = (float64) palloc(sizeof(float64data)); result = (float64) palloc(sizeof(float64data));
tmp = *arg1; tmp = *arg1;
#ifndef finite #ifndef HAVE_FINITE
errno = 0; errno = 0;
#endif #endif
*result = (float64data) exp(tmp); *result = (float64data) exp(tmp);
#ifndef finite #ifndef HAVE_FINITE
if (errno == ERANGE) if (errno == ERANGE)
#else #else
/* infinity implies overflow, zero implies underflow */ /* infinity implies overflow, zero implies underflow */
......
This diff is collapsed.
...@@ -769,6 +769,12 @@ AC_CHECK_FUNC(rint, ...@@ -769,6 +769,12 @@ AC_CHECK_FUNC(rint,
AC_DEFINE(HAVE_RINT), AC_DEFINE(HAVE_RINT),
AC_CHECK_LIB(m, rint, AC_DEFINE(HAVE_RINT), , $HPUXMATHLIB)) 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 Check to see if we have a working 64-bit integer type.
dnl This breaks down into two steps: dnl This breaks down into two steps:
dnl (1) figure out if the compiler has a 64-bit int type with working dnl (1) figure out if the compiler has a 64-bit int type with working
......
...@@ -359,6 +359,9 @@ extern int inet_aton(const char *cp, struct in_addr * addr); ...@@ -359,6 +359,9 @@ extern int inet_aton(const char *cp, struct in_addr * addr);
/* Set to 1 if you have rint() */ /* Set to 1 if you have rint() */
#undef HAVE_RINT #undef HAVE_RINT
/* Set to 1 if you have finite() */
#undef HAVE_FINITE
/* Set to 1 if you have memmove() */ /* Set to 1 if you have memmove() */
#undef HAVE_MEMMOVE #undef HAVE_MEMMOVE
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment