summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/compat.h2
-rw-r--r--configure.ac1
2 files changed, 2 insertions, 1 deletions
diff --git a/common/compat.h b/common/compat.h
index d78db0c..1b36673 100644
--- a/common/compat.h
+++ b/common/compat.h
@@ -258,7 +258,7 @@ char * strndup (const char *data,
#endif /* HAVE_STRDUP */
-#ifndef HAVE_REALLOCARRAY
+#if defined HAVE_DECL_REALLOCARRAY && !HAVE_DECL_REALLOCARRAY
void * reallocarray (void *ptr,
size_t nmemb,
diff --git a/configure.ac b/configure.ac
index a04ae43..c9877d8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -108,6 +108,7 @@ if test "$os_unix" = "yes"; then
AC_CHECK_FUNCS([getauxval getresuid secure_getenv])
AC_CHECK_FUNCS([strnstr memdup strndup strerror_r])
AC_CHECK_FUNCS([reallocarray])
+ AC_CHECK_DECLS([reallocarray], [], [], [[#include <stdlib.h>]])
AC_CHECK_FUNCS([fdwalk])
AC_CHECK_FUNCS([setenv])
AC_CHECK_FUNCS([getpeereid])