blob: fca5dd4cdd389079c6819a89c9ff1c18751ffd76 (
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
|
From c7c344302d81a36b20d3d26a3d13367c8ed2c80d Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Tue, 10 Jan 2023 12:31:03 +0100
Subject: [PATCH 1/2] configure.in: C99 compatibility fix
Avoid implicit declarations of inet_pton, exit. Include <arpa/inet.h>
for the glibc declaration. Return from main instead of calling exit.
This avoids compilation errors with future compilers.
---
configure.in | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/configure.in b/configure.in
index f1cdd10..678fe7d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -119,7 +119,7 @@ AC_CHECK_LIB(inet6, main,
AC_CHECK_FUNCS(memcpy strtol)
AC_CHECK_FUNCS(strcasecmp strncasecmp getopt_long)
AC_HEADER_STDC([])
-AC_CHECK_HEADERS(sys/types.h sys/socket.h netinet/in.h netdb.h sys/time.h sys/stat.h sys/fcntl.h malloc.h locale.h stdint.h inttypes.h idna.h)
+AC_CHECK_HEADERS(sys/types.h sys/socket.h netinet/in.h netdb.h sys/time.h sys/stat.h sys/fcntl.h malloc.h locale.h stdint.h inttypes.h idna.h arpa/inet.h)
AC_HEADER_TIME
@@ -139,13 +139,16 @@ AC_TRY_RUN(
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
int main()
{
struct in6_addr addr6;
if (inet_pton(AF_INET6, "::1", &addr6) < 1)
- exit(1);
+ return 1;
else
- exit(0);
+ return 0;
}
], [
AC_MSG_RESULT(yes)
|