[gnumeric] Configuration: add prototype for lgamma_r if headers fail to do so.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Configuration: add prototype for lgamma_r if headers fail to do so.
- Date: Fri, 21 Jun 2019 01:10:07 +0000 (UTC)
commit 190590c7e1cdc5ab701a20650993572c9b40e1d0
Author: Morten Welinder <terra gnome org>
Date: Thu Jun 20 21:09:21 2019 -0400
Configuration: add prototype for lgamma_r if headers fail to do so.
ChangeLog | 6 ++++++
NEWS | 1 +
configure.ac | 19 +++++++++++++++++++
src/numbers.h | 2 +-
4 files changed, 27 insertions(+), 1 deletion(-)
---
diff --git a/ChangeLog b/ChangeLog
index 931e1cd15..41c71fff0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2019-06-20 Morten Welinder <terra gnome org>
+
+ * configure.ac (lgamma_r): Check if we must prototype lgamma_r
+ ourselves. Fixes #402.
+ * src/numbers.h: Do so, if needed.
+
2019-06-09 Morten Welinder <terra gnome org>
* src/stf-parse.c (stf_parse_options_guess_formats): If we cannot
diff --git a/NEWS b/NEWS
index 7d3227f97..3492fa116 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ Gnumeric 1.12.46
Morten:
* Fix over-eager guessing of dates in csv. [#401]
+ * Fix Mac build problem. [#402]
--------------------------------------------------------------------------
Gnumeric 1.12.45
diff --git a/configure.ac b/configure.ac
index a905c9676..129ebcca3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -739,6 +739,25 @@ if test "$GCC" = yes -a "x$set_more_warnings" != xno; then
fi
AC_SUBST(WARN_CFLAGS)
+if test "$ac_cv_func_lgamma_r" = yes -o "$ac_cv_lib_m_lgamma_r" = yes; then
+ AC_MSG_CHECKING([if we must prototype lgamma_r ourselves])
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[#include <math.h>
+#include <stdlib.h>]],
+ [[
+ const char *s = "-3.1415e+0";
+ int sign;
+ double res = lgamma_r (atof(s), &sign);
+ return !(res >= 0.01630610 && res <= 0.01630611 && sign == +1);
+ ]])],
+ [AC_MSG_RESULT(no)],
+ [AC_MSG_RESULT(yes)
+ AC_DEFINE([NEEDS_LGAMMA_R_PROTOTYPE], 1,
+ [Define if we must prototype lgamma_r.])
+ ],
+ [AC_MSG_RESULT(assuming not)])
+fi
+
dnl **************************************************
dnl * Check for GSettings
dnl **************************************************
diff --git a/src/numbers.h b/src/numbers.h
index 97b94cce5..e9128abfe 100644
--- a/src/numbers.h
+++ b/src/numbers.h
@@ -16,7 +16,7 @@ GO_VAR_DECL int signgam;
double lgamma (double x);
#endif
-#ifdef GNM_SUPPLIES_LGAMMA_R
+#if defined(GNM_SUPPLIES_LGAMMA_R) || defined(NEEDS_LGAMMA_R_PROTOTYPE)
double lgamma_r (double x, int *signp);
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]