From: Friedrich Beckmann Date: Thu, 18 Jun 2020 06:15:42 +0000 (+0200) Subject: exp10 replaced with pow when exp10 is not available X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f1ab307d380c4d60410b911a272b6870b65c2d8;p=pspp exp10 replaced with pow when exp10 is not available 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. --- diff --git a/configure.ac b/configure.ac index 1d68d55a7e..cb36b4d624 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/src/ui/gui/find-dialog.c b/src/ui/gui/find-dialog.c index 2ff619a60a..01abc0c816 100644 --- a/src/ui/gui/find-dialog.c +++ b/src/ui/gui/find-dialog.c @@ -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 {