aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2021-04-16 12:07:54 +0100
committerNicholas Marriott <nicholas.marriott@gmail.com>2021-06-10 09:20:28 +0100
commit16b497e12b971443913e271f4d3e320b8693d411 (patch)
tree63136a33965a648ae00c002622d5da32b1adcf75
parenta25af7d0f3347dc7664d7c1c13795eb05178895d (diff)
downloadrtmux-16b497e12b971443913e271f4d3e320b8693d411.tar.gz
rtmux-16b497e12b971443913e271f4d3e320b8693d411.tar.bz2
rtmux-16b497e12b971443913e271f4d3e320b8693d411.zip
Apple have broken strtonum so check it works, from Teubel Gyorgy.
-rw-r--r--configure.ac11
1 files changed, 10 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index bfbec1d4..158e228c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -150,10 +150,19 @@ AC_REPLACE_FUNCS([ \
strlcpy \
strndup \
strsep \
- strtonum \
])
AC_FUNC_STRNLEN
+# Check if strtonum works.
+AC_MSG_CHECKING([for working strtonum])
+AC_RUN_IFELSE([AC_LANG_PROGRAM(
+ [#include <stdlib.h>],
+ [return (strtonum("0", 0, 1, NULL) == 0 ? 0 : 1);]
+ )],
+ [AC_DEFINE(HAVE_STRTONUM) AC_MSG_RESULT(yes)],
+ [AC_LIBOBJ(strtonum) AC_MSG_RESULT(no)]
+)
+
# Clang sanitizers wrap reallocarray even if it isn't available on the target
# system. When compiled it always returns NULL and crashes the program. To
# detect this we need a more complicated test.