summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian1999-07-18 20:43:13 +0000
committerBruce Momjian1999-07-18 20:43:13 +0000
commit7badb1e792acfadec6e86214ca1292e8465b7f97 (patch)
tree4f28c970b74abc2ff6ef712e34f633d393a3a085
parentb721c9e164c47717e18bcdd9c5827a5f702cbd81 (diff)
Fix configure problem.
-rw-r--r--src/backend/port/isinf.c32
-rw-r--r--src/configure.in7
-rw-r--r--src/include/config.h.in13
3 files changed, 43 insertions, 9 deletions
diff --git a/src/backend/port/isinf.c b/src/backend/port/isinf.c
index 1fa31f8263..e219326707 100644
--- a/src/backend/port/isinf.c
+++ b/src/backend/port/isinf.c
@@ -1,18 +1,12 @@
-/* $Id: isinf.c,v 1.10 1999/07/18 17:38:23 momjian Exp $ */
+/* $Id: isinf.c,v 1.11 1999/07/18 20:43:12 momjian Exp $ */
#include <math.h>
-
#include "config.h"
-#ifdef NOT_USED
-
+#if HAVE_FPCLASS
#if HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-#if HAVE_FP_CLASS_H
-#include <fp_class.h>
-#endif
-
int
isinf(double d)
{
@@ -29,6 +23,12 @@ isinf(double d)
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(x)
double x;
@@ -49,3 +49,19 @@ double x;
}
#endif
+#endif
+
+#if 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
diff --git a/src/configure.in b/src/configure.in
index 6b05753dbe..1cdb147606 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -581,6 +581,7 @@ AC_CHECK_HEADERS(crypt.h)
AC_CHECK_HEADERS(dld.h)
AC_CHECK_HEADERS(endian.h)
AC_CHECK_HEADERS(float.h)
+AC_CHECK_HEADERS(fp_class.h)
AC_CHECK_HEADERS(history.h)
AC_CHECK_HEADERS(ieeefp.h)
AC_CHECK_HEADERS(limits.h)
@@ -665,6 +666,7 @@ AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(memmove sigsetjmp sysconf)
AC_CHECK_FUNCS(sigprocmask waitpid setsid fcvt)
+AC_CHECK_FUNCS(fpclass fp_class fp_class_d class)
dnl We use our snprintf.c emulation if either snprintf() or vsnprintf()
dnl is missing. Yes, there are machines that have only one.
dnl We may also decide to use snprintf.c if snprintf() is present but does
@@ -714,6 +716,11 @@ AC_CHECK_FUNC(inet_aton,
AC_DEFINE(HAVE_INET_ATON),
INET_ATON='inet_aton.o')
AC_SUBST(INET_ATON)
+AC_CHECK_FUNC(strerror,
+ AC_DEFINE(HAVE_STRERROR),
+ [STRERROR='strerror.o' STRERROR2='../../backend/port/strerror.o'])
+AC_SUBST(STRERROR)
+AC_SUBST(STRERROR2)
AC_CHECK_FUNC(strdup,
AC_DEFINE(HAVE_STRDUP),
STRDUP='../../utils/strdup.o')
diff --git a/src/include/config.h.in b/src/include/config.h.in
index eeba1204d2..6bb03462c8 100644
--- a/src/include/config.h.in
+++ b/src/include/config.h.in
@@ -303,10 +303,21 @@
/* Set to 1 if you have snprintf() */
#undef HAVE_SNPRINTF
+/* Set to 1 if you have strerror() */
+#undef HAVE_STRERROR
+
/* Set to 1 if you have vsnprintf() */
#undef HAVE_VSNPRINTF
-/* Set to 1 if you have isinf() */
+/*
+ * Set to 1 if you have isinf().
+ * These are all realated to port/isinf.c
+ */
+#undef HAVE_FPCLASS
+#undef HAVE_FP_CLASS
+#undef HAVE_FP_CLASS_H
+#undef HAVE_FP_CLASS_D
+#undef HAVE_CLASS
#undef HAVE_ISINF
#ifndef HAVE_ISINF
int isinf(double x);