1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-09 22:41:56 +03:00

Assume that we have isinf().

Windows has this, and so do all other live platforms according to the
buildfarm, so remove the configure probe and src/port/ substitution.

This also lets us get rid of some configure probes that existed only
to support src/port/isinf.c.  I kept the port.h hack to force using
__builtin_isinf() on clang, though.

This is part of a series of commits to get rid of no-longer-relevant
configure checks and dead src/port/ code.  I'm committing them separately
to make it easier to back out individual changes if they prove less
portable than I expect.

Discussion: https://postgr.es/m/15379.1582221614@sss.pgh.pa.us
This commit is contained in:
Tom Lane
2020-02-21 13:18:27 -05:00
parent 799d22461a
commit 7fde892bc1
6 changed files with 1 additions and 192 deletions

View File

@ -104,9 +104,6 @@
/* Define to 1 if you have the `cbrt' function. */
#undef HAVE_CBRT
/* Define to 1 if you have the `class' function. */
#undef HAVE_CLASS
/* Define to 1 if you have the `clock_gettime' function. */
#undef HAVE_CLOCK_GETTIME
@ -206,18 +203,6 @@
/* Define to 1 if you have the `fls' function. */
#undef HAVE_FLS
/* Define to 1 if you have the `fpclass' function. */
#undef HAVE_FPCLASS
/* Define to 1 if you have the `fp_class' function. */
#undef HAVE_FP_CLASS
/* Define to 1 if you have the `fp_class_d' function. */
#undef HAVE_FP_CLASS_D
/* Define to 1 if you have the <fp_class.h> header file. */
#undef HAVE_FP_CLASS_H
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
#undef HAVE_FSEEKO
@ -295,9 +280,6 @@
/* Define to 1 if you have the `history_truncate_file' function. */
#undef HAVE_HISTORY_TRUNCATE_FILE
/* Define to 1 if you have the <ieeefp.h> header file. */
#undef HAVE_IEEEFP_H
/* Define to 1 if you have the <ifaddrs.h> header file. */
#undef HAVE_IFADDRS_H
@ -325,9 +307,6 @@
/* Define to 1 if you have support for IPv6. */
#undef HAVE_IPV6
/* Define to 1 if you have isinf(). */
#undef HAVE_ISINF
/* Define to 1 if __builtin_constant_p(x) implies "i"(x) acceptance. */
#undef HAVE_I_CONSTRAINT__BUILTIN_CONSTANT_P

View File

@ -352,9 +352,6 @@ extern int getpeereid(int sock, uid_t *uid, gid_t *gid);
#endif
#endif
#ifndef HAVE_ISINF
extern int isinf(double x);
#else
/*
* Glibc doesn't use the builtin for clang due to a *gcc* bug in a version
* newer than the gcc compatibility clang claims to have. This would cause a
@ -370,7 +367,6 @@ extern int isinf(double x);
#define isinf __builtin_isinf
#endif /* __has_builtin(isinf) */
#endif /* __clang__ && !__cplusplus */
#endif /* !HAVE_ISINF */
#ifndef HAVE_EXPLICIT_BZERO
extern void explicit_bzero(void *buf, size_t len);

View File

@ -1,81 +0,0 @@
/*-------------------------------------------------------------------------
*
* isinf.c
*
* Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* src/port/isinf.c
*
*-------------------------------------------------------------------------
*/
#include "c.h"
#include <float.h>
#include <math.h>
#if HAVE_FPCLASS /* this is _not_ HAVE_FP_CLASS, and not typo */
#if HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
int
isinf(double d)
{
fpclass_t type = fpclass(d);
switch (type)
{
case FP_NINF:
case FP_PINF:
return 1;
default:
break;
}
return 0;
}
#else
#if defined(HAVE_FP_CLASS) || defined(HAVE_FP_CLASS_D)
#if HAVE_FP_CLASS_H
#include <fp_class.h>
#endif
int
isinf(double x)
{
#if HAVE_FP_CLASS
int fpclass = fp_class(x);
#else
int fpclass = fp_class_d(x);
#endif
if (fpclass == FP_POS_INF)
return 1;
if (fpclass == FP_NEG_INF)
return -1;
return 0;
}
#elif defined(HAVE_CLASS)
int
isinf(double x)
{
int fpclass = class(x);
if (fpclass == FP_PLUS_INF)
return 1;
if (fpclass == FP_MINUS_INF)
return -1;
return 0;
}
#endif
#endif

View File

@ -211,7 +211,6 @@ sub GenerateFiles
HAVE_BIO_GET_DATA => undef,
HAVE_BIO_METH_NEW => undef,
HAVE_CBRT => undef,
HAVE_CLASS => undef,
HAVE_CLOCK_GETTIME => undef,
HAVE_COMPUTED_GOTO => undef,
HAVE_COPYFILE => undef,
@ -240,10 +239,6 @@ sub GenerateFiles
HAVE_EXPLICIT_BZERO => undef,
HAVE_FDATASYNC => undef,
HAVE_FLS => undef,
HAVE_FPCLASS => undef,
HAVE_FP_CLASS => undef,
HAVE_FP_CLASS_D => undef,
HAVE_FP_CLASS_H => undef,
HAVE_FSEEKO => 1,
HAVE_FUNCNAME__FUNC => undef,
HAVE_FUNCNAME__FUNCTION => 1,
@ -269,7 +264,6 @@ sub GenerateFiles
HAVE_GSSAPI_H => undef,
HAVE_HISTORY_H => undef,
HAVE_HISTORY_TRUNCATE_FILE => undef,
HAVE_IEEEFP_H => undef,
HAVE_IFADDRS_H => undef,
HAVE_INET_ATON => undef,
HAVE_INT_TIMEZONE => 1,
@ -279,7 +273,6 @@ sub GenerateFiles
HAVE_INT_OPTERR => undef,
HAVE_INT_OPTRESET => undef,
HAVE_IPV6 => 1,
HAVE_ISINF => 1,
HAVE_I_CONSTRAINT__BUILTIN_CONSTANT_P => undef,
HAVE_KQUEUE => undef,
HAVE_LANGINFO_H => undef,