-/* $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)
{
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;
}
#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
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)
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
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')
/* 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);