diff options
Diffstat (limited to 'net-misc/jwhois/files/jwhois-4.0-avoid-implicit-declarations.patch')
-rw-r--r-- | net-misc/jwhois/files/jwhois-4.0-avoid-implicit-declarations.patch | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/net-misc/jwhois/files/jwhois-4.0-avoid-implicit-declarations.patch b/net-misc/jwhois/files/jwhois-4.0-avoid-implicit-declarations.patch new file mode 100644 index 000000000000..fca5dd4cdd38 --- /dev/null +++ b/net-misc/jwhois/files/jwhois-4.0-avoid-implicit-declarations.patch @@ -0,0 +1,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) |