zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] use scalbn(3) instead of scalb(3)
@ 2016-08-19  8:58 Jun T.
  0 siblings, 0 replies; only message in thread
From: Jun T. @ 2016-08-19  8:58 UTC (permalink / raw)
  To: zsh-workers

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 \





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-08-19  9:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-19  8:58 [PATCH] use scalbn(3) instead of scalb(3) Jun T.

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).