Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] use scalbn(3) instead of scalb(3)
- X-seq: zsh-workers 39064
- From: "Jun T." <takimoto-j@xxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] use scalbn(3) instead of scalb(3)
- Date: Fri, 19 Aug 2016 17:58:17 +0900
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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 \
Messages sorted by:
Reverse Date,
Date,
Thread,
Author