apr/apr-configure-c99-1.patch
2023-01-16 18:29:12 +01:00

113 lines
2.7 KiB
Diff

------------------------------------------------------------------------
r1882980 | jim | 2020-10-29 21:23:11 +0100 (Thu, 29 Oct 2020) | 2 lines
calls to exit() require stdlib.h or else we get -Werror,-Wimplicit-function-declaration
------------------------------------------------------------------------
diff --git a/build/apr_common.m4 b/build/apr_common.m4
index 6f5782e674384dbd..b8c14b977cfc422b 100644
--- a/build/apr_common.m4
+++ b/build/apr_common.m4
@@ -527,6 +527,7 @@ AC_TRY_RUN([
#include <errno.h>
#include <string.h>
#include <stdio.h>
+#include <stdlib.h>
main()
{
char buf[1024];
diff --git a/build/apr_network.m4 b/build/apr_network.m4
index 248898283080317d..d330ba16f38f649f 100644
--- a/build/apr_network.m4
+++ b/build/apr_network.m4
@@ -63,6 +63,9 @@ AC_DEFUN([APR_CHECK_WORKING_GETADDRINFO], [
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
int main(void) {
struct addrinfo hints, *ai;
@@ -151,6 +154,9 @@ AC_DEFUN([APR_CHECK_WORKING_GETNAMEINFO], [
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
int main(void) {
struct sockaddr_in sa;
@@ -194,6 +200,9 @@ AC_DEFUN([APR_CHECK_NEGATIVE_EAI], [
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
int main(void) {
if (EAI_ADDRFAMILY < 0) {
@@ -403,6 +412,9 @@ AC_DEFUN([APR_CHECK_TCP_NODELAY_INHERITED], [
#ifndef HAVE_SOCKLEN_T
typedef int socklen_t;
#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
int main(void) {
int listen_s, connected_s, client_s;
int listen_port, rc;
@@ -588,6 +600,9 @@ typedef int socklen_t;
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
int main(void) {
int listen_s, connected_s, client_s;
int listen_port, rc;
diff --git a/configure.in b/configure.in
index 6833b32d04de9639..7f6352860dfe41d5 100644
--- a/configure.in
+++ b/configure.in
@@ -2208,6 +2208,7 @@ AC_TRY_RUN([
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
+#include <stdlib.h>
main()
{
struct rlimit limit;
@@ -2244,6 +2245,7 @@ AC_TRY_RUN([
#include <stdlib.h>
#include <fcntl.h>
#include <semaphore.h>
+#include <stdlib.h>
#ifndef SEM_FAILED
#define SEM_FAILED (-1)
#endif
@@ -2307,6 +2309,7 @@ if test "$threads" = "1"; then
AC_TRY_RUN([
#include <sys/types.h>
#include <pthread.h>
+#include <stdlib.h>
int main()
{
pthread_mutex_t mutex;
@@ -2430,7 +2433,9 @@ AC_TRY_RUN([
#endif
#include <fcntl.h>
#include <errno.h>
-
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
int fd;
struct flock proc_mutex_lock_it = {0};
const char *fname = "conftest.fcntl";