Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: isinf()/isnan() configure tests
- X-seq: zsh-workers 43357
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: PATCH: isinf()/isnan() configure tests
- Date: Fri, 31 Aug 2018 15:45:49 +0200
- Authentication-results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=yahoo.co.uk
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1535723154; bh=3tma6VOvovic7RJj87WGYUWhGmcTCAmC8aOVHW7b9rc=; h=From:To:Subject:Date:From:Subject; b=HjylBV0kA1K1kAhbjxBEnUz/JcMNBAC0DWfFfJaYmsre1vBlDUul92qpBdGYEWdnw/SFaO10i9zIQlQ6aYGcCKtUn7lxTNuhBqv9hSPRILVNjeDzv6Nm5xiUuFGWD5h2XVy0tCok8TlIf6de9JCoTlLv+awAAV61QAw77hQ102hk/+RmFwkF5M00+Y/59hIOx95jYI4+uVkyhGttuFuzjxXuBwhTYambdCJiMY3C88fcn27O1qRV0MrzSCT3d1vmCH5OybET11qNfr93gUq7tD8x2KG8VAq9zEuoRaRTNBJaK5LHL9NmFxYwah/K5JqPl8tExbhk3UuyYVuR8jG95w==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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],
Messages sorted by:
Reverse Date,
Date,
Thread,
Author