aboutsummaryrefslogtreecommitdiff
path: root/libs/apr/patches/000-060-backport-require-stdlib.patch
blob: 5a15db2672b219fa1cb05198ca941dad7f894dcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
From 9d9c6990afaa7ad8eea0be524481bb48a5dd1b09
From: Jim Jagielski <jim@apache.org>
Date: Thu, 29 Oct 2020 20:16:55 +0000
Subject: [PATCH] calls to exit() require stdlib.h or else we get
 -Werror,-Wimplicit-function-declaration

git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1882979 13f79535-47bb-0310-9956-ffa450edef68
---
 build/apr_common.m4  |  3 +++
 build/apr_network.m4 | 15 +++++++++++++++
 configure.in         |  6 +++++-
 3 files changed, 23 insertions(+), 1 deletion(-)

--- a/build/apr_common.m4
+++ b/build/apr_common.m4
@@ -495,6 +495,9 @@ AC_CACHE_CHECK([whether return code from
 #include <errno.h>
 #include <string.h>
 #include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
 main()
 {
   char buf[1024];
--- 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_INHERITE
 #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;
--- 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;
@@ -2307,6 +2308,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 +2432,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";