--- configure.orig	2021-11-10 00:09:17.000000000 +1100
+++ configure	2021-11-10 00:21:14.000000000 +1100
@@ -27627,7 +27627,15 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
+#if HAVE_STDLIB_H
 #include <stdlib.h>
+#endif
+#if HAVE_STDIO_H
+#include <stdio.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
   int main() {
     if(setresuid(-1,-1,-1)) {
       perror("setresuid:");
@@ -27741,7 +27749,9 @@
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
       #include <stdarg.h>
       void f (int i, ...) {
 	 va_list args1, args2;
@@ -27823,7 +27833,9 @@
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
       #include <stdarg.h>
       void f (int i, ...) {
 	 va_list args1, args2;
@@ -28248,10 +28260,10 @@
 #if HAVE_WINSOCK2_H
 #include <winsock2.h>
 #endif
-main() {
+int main() {
 	FILE *fp = fopen("conftestval", "w");
 	fprintf (fp, "%d\n", FD_SETSIZE);
-	exit(0);
+	return (0);
 }
 
 _ACEOF
@@ -28341,7 +28353,7 @@
 #include <sys/time.h>	/* needed on FreeBSD */
 #include <sys/param.h>
 #include <sys/resource.h>
-main() {
+int main() {
 	FILE *fp;
 	int i,j;
 #if defined(__CYGWIN32__) || defined (__CYGWIN__)
@@ -28394,7 +28406,7 @@
 #endif /* IF !DEF CYGWIN */
 	fp = fopen("conftestval", "w");
 	fprintf (fp, "%d\n", i & ~0x3F);
-	exit(0);
+	return (0);
 }
 
 _ACEOF
