[goffice] compilation: we can do without finitel.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [goffice] compilation: we can do without finitel.
- Date: Sun, 16 May 2010 21:12:50 +0000 (UTC)
commit 65ffa6415d47beb5109435b9f1ac4ac2505df8c7
Author: Morten Welinder <terra gnome org>
Date: Sun May 16 17:12:34 2010 -0400
compilation: we can do without finitel.
configure.in | 6 +++---
goffice/math/go-math.c | 10 ++++++++++
goffice/math/go-math.h | 3 +--
3 files changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/configure.in b/configure.in
index 412e93c..46416ac 100644
--- a/configure.in
+++ b/configure.in
@@ -516,7 +516,7 @@ if test "x$with_long_double" = "xyes"; then
ss_dir="/opt/SUNWspro"
fi
sunmathlinkstuff="-L$ss_dir/lib -R$ss_dir/lib -lsunmath"
- for ldfunc in fabsl logl log10l ceill floorl powl isnanl finitel; do
+ for ldfunc in fabsl logl log10l ceill floorl powl isnanl; do
AC_CHECK_FUNC($ldfunc,
,
[AC_CHECK_LIB(m,
@@ -551,6 +551,7 @@ if test "x$with_long_double" = "xyes"; then
GOFFICE_CHECK_FUNC(modfl)
GOFFICE_CHECK_FUNC(ldexpl)
GOFFICE_CHECK_FUNC(frexpl)
+ AC_CHECK_FUNCS(finitel)
AC_CHECK_FUNCS(strtold)
if test "$ac_cv_func_strtold" = yes; then
@@ -561,8 +562,7 @@ if test "x$with_long_double" = "xyes"; then
const char *s = "+3.1415e+0";
char *theend;
long double res = strtold (s, &theend);
- return !(*theend == 0 && finitel (res) &&
- res >= 3.14 && res <= 3.15);
+ return !(*theend == 0 && res >= 3.14 && res <= 3.15);
}],
[AC_MSG_RESULT(no)],
[AC_MSG_RESULT(yes)
diff --git a/goffice/math/go-math.c b/goffice/math/go-math.c
index 5462135..879b108 100644
--- a/goffice/math/go-math.c
+++ b/goffice/math/go-math.c
@@ -486,6 +486,16 @@ long double go_nanl;
long double go_pinfl;
long double go_ninfl;
+int
+go_finitel (long double x)
+{
+#ifdef HAVE_FINITEL
+ return finitel (x);
+#else
+ return fabs (x) < go_pinfl;
+#endif
+}
+
long double
go_pow2l (int n)
{
diff --git a/goffice/math/go-math.h b/goffice/math/go-math.h
index 01e0852..1e89dea 100644
--- a/goffice/math/go-math.h
+++ b/goffice/math/go-math.h
@@ -72,7 +72,7 @@ long double go_fake_ceill (long double x);
long double go_fake_roundl (long double x);
long double go_fake_truncl (long double x);
-#define go_finitel finitel
+int go_finitel (long double x);
long double go_pow2l (int n);
long double go_pow10l (int n);
@@ -99,7 +99,6 @@ long double modfl (long double x, long double *iptr);
#ifdef _MSC_VER
#define isnan _isnan
-#define finite _finite
#endif
/* ------------------------------------------------------------------------- */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]