Subject: [PATCH] use scalbn(3) instead of scalb(3)
From: "Jun T." <[email-masked]>
To: [email-masked]
Date: Fri, 19 Aug 2016 17:58:17 +0900
List-Id: Zsh Workers List <zsh-workers.zsh.org>

scalb(3) is deprecated on some systems; scalbn(3) is the recommended
replacement. I guess virtually all the systems have scalbn(), but
added a check just in case.

diff --git a/Src/Modules/mathfunc.c b/Src/Modules/mathfunc.c
index 451b3cf..a7e8b29 100644
--- a/Src/Modules/mathfunc.c
+++ b/Src/Modules/mathfunc.c
@@ -411,7 +411,11 @@ math_func(char *name, int argc, mnumber *argv, int id)
       break;
 
   case MF_SCALB:
+#ifdef HAVE_SCALBN
+      retd = scalbn(argd, argi);
+#else
       retd = scalb(argd, argi);
+#endif
       break;
 
 #ifdef HAVE_SIGNGAM
diff --git a/configure.ac b/configure.ac
index bac62a6..0e0bd53 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1305,6 +1305,7 @@ AC_CHECK_FUNCS(strftime strptime mktime timelocal \
 	       setlocale \
 	       uname \
 	       signgam tgamma \
+	       scalbn \
 	       putenv getenv setenv unsetenv xw\
 	       brk sbrk \
 	       pathconf sysconf \