exp10 replaced with pow when exp10 is not available
authorFriedrich Beckmann <friedrich.beckmann@gmx.de>
Thu, 18 Jun 2020 06:15:42 +0000 (08:15 +0200)
committerFriedrich Beckmann <friedrich.beckmann@gmx.de>
Thu, 18 Jun 2020 06:15:42 +0000 (08:15 +0200)
The exp10 function that was introduced by commit aae1a8f067ddd9c09
in the find-dialog is not available on MacOS. I added a check
and replace it with pow if exp10 is not available.

configure.ac
src/ui/gui/find-dialog.c

index 1d68d55a7ef45219b2e53b47592796c4abc5e106..cb36b4d624f900f36ca516732484d43095520767 100644 (file)
@@ -296,6 +296,9 @@ if test x"$enable_debug" = x"yes"  ; then
   AC_DEFINE(DEBUGGING, 1, [Define to 1 if debugging is enabled.])
 fi
 
+# exp10 is not available on all systems (MacOS)
+AC_CHECK_LIB(m, exp10, [AC_DEFINE([HAVE_EXP10],[1],[Define to 1 if your system has 'exp10'.])])
+
 # iconv is required
 AM_ICONV
 if test "$am_cv_func_iconv" != "yes"; then
index 2ff619a60a25c0c974dcc62092a97a7a40d9f540..01abc0c81644c2a7d6c8e07a83050bbc641f9428 100644 (file)
@@ -49,6 +49,13 @@ which match particular strings */
 #define _(msgid) gettext (msgid)
 #define N_(msgid) msgid
 
+/* Some systems like MacOS do not have exp10 */
+#ifndef HAVE_EXP10
+inline static double exp10(double x)
+{
+  return pow(10.0, x);
+}
+#endif
 
 struct find_dialog
 {