mirror of
https://github.com/postgres/postgres.git
synced 2025-06-27 23:21:58 +03:00
finite() no longer used; remove finite() platform-specific
infrastructure.
This commit is contained in:
59
configure
vendored
59
configure
vendored
@ -15489,65 +15489,6 @@ done
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
echo "$as_me:$LINENO: checking for finite" >&5
|
|
||||||
echo $ECHO_N "checking for finite... $ECHO_C" >&6
|
|
||||||
cat >conftest.$ac_ext <<_ACEOF
|
|
||||||
/* confdefs.h. */
|
|
||||||
_ACEOF
|
|
||||||
cat confdefs.h >>conftest.$ac_ext
|
|
||||||
cat >>conftest.$ac_ext <<_ACEOF
|
|
||||||
/* end confdefs.h. */
|
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
double glob_double;
|
|
||||||
|
|
||||||
int
|
|
||||||
main ()
|
|
||||||
{
|
|
||||||
return finite(glob_double) ? 0 : 1;
|
|
||||||
;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
_ACEOF
|
|
||||||
rm -f conftest.$ac_objext conftest$ac_exeext
|
|
||||||
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
|
|
||||||
(eval $ac_link) 2>conftest.er1
|
|
||||||
ac_status=$?
|
|
||||||
grep -v '^ *+' conftest.er1 >conftest.err
|
|
||||||
rm -f conftest.er1
|
|
||||||
cat conftest.err >&5
|
|
||||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
|
||||||
(exit $ac_status); } &&
|
|
||||||
{ ac_try='test -z "$ac_c_werror_flag"
|
|
||||||
|| test ! -s conftest.err'
|
|
||||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
|
||||||
(eval $ac_try) 2>&5
|
|
||||||
ac_status=$?
|
|
||||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
|
||||||
(exit $ac_status); }; } &&
|
|
||||||
{ ac_try='test -s conftest$ac_exeext'
|
|
||||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
|
||||||
(eval $ac_try) 2>&5
|
|
||||||
ac_status=$?
|
|
||||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
|
||||||
(exit $ac_status); }; }; then
|
|
||||||
|
|
||||||
cat >>confdefs.h <<\_ACEOF
|
|
||||||
#define HAVE_FINITE 1
|
|
||||||
_ACEOF
|
|
||||||
|
|
||||||
echo "$as_me:$LINENO: result: yes" >&5
|
|
||||||
echo "${ECHO_T}yes" >&6
|
|
||||||
else
|
|
||||||
echo "$as_me: failed program was:" >&5
|
|
||||||
sed 's/^/| /' conftest.$ac_ext >&5
|
|
||||||
|
|
||||||
echo "$as_me:$LINENO: result: no" >&5
|
|
||||||
echo "${ECHO_T}no" >&6
|
|
||||||
fi
|
|
||||||
rm -f conftest.err conftest.$ac_objext \
|
|
||||||
conftest$ac_exeext conftest.$ac_ext
|
|
||||||
|
|
||||||
echo "$as_me:$LINENO: checking for sigsetjmp" >&5
|
echo "$as_me:$LINENO: checking for sigsetjmp" >&5
|
||||||
echo $ECHO_N "checking for sigsetjmp... $ECHO_C" >&6
|
echo $ECHO_N "checking for sigsetjmp... $ECHO_C" >&6
|
||||||
cat >conftest.$ac_ext <<_ACEOF
|
cat >conftest.$ac_ext <<_ACEOF
|
||||||
|
13
configure.in
13
configure.in
@ -1,5 +1,5 @@
|
|||||||
dnl Process this file with autoconf to produce a configure script.
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
dnl $PostgreSQL: pgsql/configure.in,v 1.493 2006/12/21 16:05:12 petere Exp $
|
dnl $PostgreSQL: pgsql/configure.in,v 1.494 2007/01/02 21:25:50 momjian Exp $
|
||||||
dnl
|
dnl
|
||||||
dnl Developers, please strive to achieve this order:
|
dnl Developers, please strive to achieve this order:
|
||||||
dnl
|
dnl
|
||||||
@ -1033,17 +1033,6 @@ if test "$with_readline" = yes; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
dnl Cannot use AC_CHECK_FUNC because finite may be a macro
|
|
||||||
AC_MSG_CHECKING(for finite)
|
|
||||||
AC_TRY_LINK([
|
|
||||||
#include <math.h>
|
|
||||||
double glob_double;
|
|
||||||
],
|
|
||||||
[return finite(glob_double) ? 0 : 1;],
|
|
||||||
[AC_DEFINE(HAVE_FINITE, 1, [Define to 1 if you have finite().])
|
|
||||||
AC_MSG_RESULT(yes)],
|
|
||||||
[AC_MSG_RESULT(no)])
|
|
||||||
|
|
||||||
dnl Cannot use AC_CHECK_FUNC because sigsetjmp may be a macro
|
dnl Cannot use AC_CHECK_FUNC because sigsetjmp may be a macro
|
||||||
dnl (especially on GNU libc)
|
dnl (especially on GNU libc)
|
||||||
dnl See also comments in c.h.
|
dnl See also comments in c.h.
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.133 2007/01/02 20:50:35 momjian Exp $
|
* $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.134 2007/01/02 21:25:50 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -18,10 +18,6 @@
|
|||||||
#include <float.h>
|
#include <float.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
/* for finite() on Solaris */
|
|
||||||
#ifdef HAVE_IEEEFP_H
|
|
||||||
#include <ieeefp.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "catalog/pg_type.h"
|
#include "catalog/pg_type.h"
|
||||||
#include "libpq/pqformat.h"
|
#include "libpq/pqformat.h"
|
||||||
@ -34,12 +30,6 @@
|
|||||||
#define M_PI 3.14159265358979323846
|
#define M_PI 3.14159265358979323846
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Recent HPUXen have isfinite() macro in place of more standard finite() */
|
|
||||||
#if !defined(HAVE_FINITE) && defined(isfinite)
|
|
||||||
#define finite(x) isfinite(x)
|
|
||||||
#define HAVE_FINITE 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Visual C++ etc lacks NAN, and won't accept 0.0/0.0. NAN definition from
|
/* Visual C++ etc lacks NAN, and won't accept 0.0/0.0. NAN definition from
|
||||||
* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang/html/vclrfNotNumberNANItems.asp
|
* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang/html/vclrfNotNumberNANItems.asp
|
||||||
*/
|
*/
|
||||||
@ -167,11 +157,10 @@ is_infinite(double val)
|
|||||||
|
|
||||||
if (inf == 0)
|
if (inf == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
else if (val > 0)
|
||||||
if (val > 0)
|
|
||||||
return 1;
|
return 1;
|
||||||
|
else
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1709,11 +1698,7 @@ dtan(PG_FUNCTION_ARGS)
|
|||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
result = tan(arg1);
|
result = tan(arg1);
|
||||||
if (errno != 0
|
if (errno != 0)
|
||||||
#ifdef HAVE_FINITE
|
|
||||||
|| !finite(result)
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
|
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
|
||||||
errmsg("input is out of range")));
|
errmsg("input is out of range")));
|
||||||
|
@ -116,9 +116,6 @@
|
|||||||
/* Define to 1 if you have the `fdatasync' function. */
|
/* Define to 1 if you have the `fdatasync' function. */
|
||||||
#undef HAVE_FDATASYNC
|
#undef HAVE_FDATASYNC
|
||||||
|
|
||||||
/* Define to 1 if you have finite(). */
|
|
||||||
#undef HAVE_FINITE
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `fpclass' function. */
|
/* Define to 1 if you have the `fpclass' function. */
|
||||||
#undef HAVE_FPCLASS
|
#undef HAVE_FPCLASS
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.63 2006/10/19 20:03:08 tgl Exp $ */
|
/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.64 2007/01/02 21:25:50 momjian Exp $ */
|
||||||
|
|
||||||
#if defined(_MSC_VER) || defined(__BORLANDC__)
|
#if defined(_MSC_VER) || defined(__BORLANDC__)
|
||||||
#define WIN32_ONLY_COMPILER
|
#define WIN32_ONLY_COMPILER
|
||||||
@ -287,7 +287,6 @@ typedef unsigned short mode_t;
|
|||||||
|
|
||||||
#define isinf(x) ((_fpclass(x) == _FPCLASS_PINF) || (_fpclass(x) == _FPCLASS_NINF))
|
#define isinf(x) ((_fpclass(x) == _FPCLASS_PINF) || (_fpclass(x) == _FPCLASS_NINF))
|
||||||
#define isnan(x) _isnan(x)
|
#define isnan(x) _isnan(x)
|
||||||
#define finite(x) _finite(x)
|
|
||||||
|
|
||||||
#ifndef BIG_ENDIAN
|
#ifndef BIG_ENDIAN
|
||||||
#define BIG_ENDIAN 4321
|
#define BIG_ENDIAN 4321
|
||||||
|
Reference in New Issue
Block a user