diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-05-11 05:45:51 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-05-11 05:45:51 +0100 |
commit | 980af9d76d4b7d7541b41eeff427e5cbd5cf7ec3 (patch) | |
tree | 0b86d672e967b7f78ba20788fd85818efd54dc01 /net-misc/asterisk/files/asterisk-18.17.1-20.2.1-configure-fix-test-code-to-match-gethostbyname_r-pro.patch | |
parent | f356af92b88d56b78588e81310493d4f5a2f6d18 (diff) |
gentoo auto-resync : 11:05:2023 - 05:45:51
Diffstat (limited to 'net-misc/asterisk/files/asterisk-18.17.1-20.2.1-configure-fix-test-code-to-match-gethostbyname_r-pro.patch')
-rw-r--r-- | net-misc/asterisk/files/asterisk-18.17.1-20.2.1-configure-fix-test-code-to-match-gethostbyname_r-pro.patch | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/net-misc/asterisk/files/asterisk-18.17.1-20.2.1-configure-fix-test-code-to-match-gethostbyname_r-pro.patch b/net-misc/asterisk/files/asterisk-18.17.1-20.2.1-configure-fix-test-code-to-match-gethostbyname_r-pro.patch new file mode 100644 index 000000000000..540888368223 --- /dev/null +++ b/net-misc/asterisk/files/asterisk-18.17.1-20.2.1-configure-fix-test-code-to-match-gethostbyname_r-pro.patch @@ -0,0 +1,71 @@ +From 79468a12c3533720c938731a8b7728ba4ff5a326 Mon Sep 17 00:00:00 2001 +From: Jaco Kroon <jaco@uls.co.za> +Date: Wed, 10 May 2023 23:13:17 +0200 +Subject: [PATCH] configure: fix test code to match gethostbyname_r prototype. + +This enables the test to work with CC=clang. + +Without this the test for 6 args would fail with: + +utils.c:99:12: error: static declaration of 'gethostbyname_r' follows non-static declaration +static int gethostbyname_r (const char *name, struct hostent *ret, char *buf, + ^ +/usr/include/netdb.h:177:12: note: previous declaration is here +extern int gethostbyname_r (const char *__restrict __name, + ^ + +Fixing the expected return type to int sorts this out. + +Signed-off-by: Jaco Kroon <jaco@uls.co.za> +--- + configure | 4 ++-- + configure.ac | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/configure b/configure +index bf78e2aade..b046dfc755 100755 +--- a/configure ++++ b/configure +@@ -17537,7 +17537,7 @@ $as_echo_n "checking for gethostbyname_r with 6 arguments... " >&6; } + int + main () + { +-struct hostent *he = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (struct hostent **)NULL, (int *)NULL); ++int r = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (struct hostent **)NULL, (int *)NULL); + ; + return 0; + } +@@ -17565,7 +17565,7 @@ $as_echo_n "checking for gethostbyname_r with 5 arguments... " >&6; } + int + main () + { +-struct hostent *he = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (int *)NULL); ++int r = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (int *)NULL); + ; + return 0; + } +diff --git a/configure.ac b/configure.ac +index ab6632beac..aeec352054 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -962,7 +962,7 @@ if test "x$have_gethostbyname_r_public_declaration" = "xyes"; then + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([#include <stdlib.h> + #include <netdb.h>], +- [struct hostent *he = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (struct hostent **)NULL, (int *)NULL);])], ++ [int r = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (struct hostent **)NULL, (int *)NULL);])], + AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_GETHOSTBYNAME_R_6], 1, [Define to 1 if your system has gethostbyname_r with 6 arguments.]), + AC_MSG_RESULT(no) +@@ -972,7 +972,7 @@ if test "x$have_gethostbyname_r_public_declaration" = "xyes"; then + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([#include <stdlib.h> + #include <netdb.h>], +- [struct hostent *he = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (int *)NULL);])], ++ [int r = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (int *)NULL);])], + AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_GETHOSTBYNAME_R_5], 1, [Define to 1 if your system has gethostbyname_r with 5 arguments.]), + AC_MSG_RESULT(no) +-- +2.39.3 + |