Blob Blame History Raw
configure: Avoid implicit declaration of exit, strcmp in snprintf
probes.  Future compilers will not support implicit function
declarations by default, so add the additional #include directives for
the appropriate function prototypes.

Submitted upstream: <https://github.com/xroche/httrack/pull/252>

diff --git a/configure b/configure
index bb921b05d1bb92e3..f523019ace12d8d8 100755
--- a/configure
+++ b/configure
@@ -14386,6 +14386,8 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 
 int main(void)
 {
@@ -14425,6 +14427,8 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <stdarg.h>
 
 int my_vsnprintf (char *buf, const char *tmpl, ...)
diff --git a/m4/snprintf.m4 b/m4/snprintf.m4
index d1c6dc8a3ce14673..2a84428d7e58c9e4 100644
--- a/m4/snprintf.m4
+++ b/m4/snprintf.m4
@@ -4,6 +4,8 @@ AC_MSG_CHECKING(for working snprintf)
 AC_CACHE_VAL(ac_cv_have_working_snprintf,
 [AC_TRY_RUN(
 [#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 
 int main(void)
 {
@@ -23,6 +25,8 @@ AC_MSG_CHECKING(for working vsnprintf)
 AC_CACHE_VAL(ac_cv_have_working_vsnprintf,
 [AC_TRY_RUN(
 [#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <stdarg.h>
 
 int my_vsnprintf (char *buf, const char *tmpl, ...)