From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Zsh workers <zsh-workers@zsh.org>
Subject: PATCH: isinf()/isnan() configure tests
Date: Fri, 31 Aug 2018 15:45:49 +0200 [thread overview]
Message-ID: <25573-1535723149.923050@vTBf.cIL0.LT2D> (raw)
The new tests for isinf/isnan using AC_CHECK_FUNCS are not sufficient as
they can be defined as macros.
Oliver
diff --git a/configure.ac b/configure.ac
index 5e13c0f11..5513e25f1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1278,7 +1278,6 @@ AC_CHECK_FUNCS(strftime strptime mktime timelocal \
erand48 open_memstream \
posix_openpt \
wctomb iconv \
- isinf isnan \
grantpt unlockpt ptsname \
htons ntohs \
regcomp regexec regerror regfree \
@@ -1291,6 +1290,27 @@ AC_CHECK_FUNCS(strftime strptime mktime timelocal \
setutxent getutxent endutxent getutent)
AC_FUNC_STRCOLL
+# isinf() and isnan() can exist as either functions or macros.
+AH_TEMPLATE([HAVE_ISINF],
+ [Define to 1 if you have the `isinf' macro or function.])
+AC_MSG_CHECKING([for isinf])
+AC_LINK_IFELSE([AC_LANG_SOURCE(
+[[#include <math.h>
+int main () { return (isinf(1.0) != 0); }]])],
+ [AC_MSG_RESULT([yes])
+ AC_DEFINE([HAVE_ISINF])],
+ [AC_MSG_RESULT([no])])
+
+AH_TEMPLATE([HAVE_ISNAN],
+ [Define to 1 if you have the `isnan' macro or function.])
+AC_MSG_CHECKING([for isnan])
+AC_LINK_IFELSE([AC_LANG_SOURCE([[
+#include <math.h>
+int main () { return (isnan(1.0) != 0); }]])],
+ [AC_MSG_RESULT([yes])
+ AC_DEFINE([HAVE_ISNAN])],
+ [AC_MSG_RESULT([no])])
+
AH_TEMPLATE([REALPATH_ACCEPTS_NULL],
[Define if realpath() accepts NULL as its second argument.])
AC_CACHE_CHECK([if realpath accepts NULL],
reply other threads:[~2018-08-31 13:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=25573-1535723149.923050@vTBf.cIL0.LT2D \
--to=okiddle@yahoo.co.uk \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).