configure: FreeBSD getnameinfo() sig is even more borked than OpenBSD
parent
fc34ea4e58
commit
eac04d21ef
|
@ -175,16 +175,20 @@ ishaiku() {
|
|||
|
||||
check_compile 'whether C compiler works' '' 'int main() {return 0;}' || fail 'error: install a C compiler and library'
|
||||
|
||||
if ! check_compile 'whether getnameinfo() servlen argument is POSIX compliant (socklen_t)' "-DGN_SERVLEN_T=socklen_t -DGN_FLAGS_T=int" \
|
||||
if ! check_compile 'whether getnameinfo() servlen argument is POSIX compliant (socklen_t)' "-DGN_NODELEN_T=socklen_t -DGN_SERVLEN_T=socklen_t -DGN_FLAGS_T=int" \
|
||||
'#define _GNU_SOURCE\n#include <netdb.h>\nint getnameinfo(const struct sockaddr *, socklen_t, char *, socklen_t, char *, socklen_t, int);int main() {\nreturn 0;}' ; then
|
||||
|
||||
# GLIBC < 2.14
|
||||
if ! check_compile 'whether getnameinfo() flags argument is unsigned' "-DGN_SERVLEN_T=socklen_t -DGN_FLAGS_T=unsigned" \
|
||||
if ! check_compile 'whether getnameinfo() flags argument is unsigned' "-DGN_NODELEN_T=socklen_t -DGN_SERVLEN_T=socklen_t -DGN_FLAGS_T=unsigned" \
|
||||
'#define _GNU_SOURCE\n#include <netdb.h>\nint getnameinfo(const struct sockaddr *, socklen_t, char *, socklen_t, char *, socklen_t, unsigned);int main() {\nreturn 0;}' ; then
|
||||
# OpenBSD
|
||||
if ! check_compile 'whether getnameinfo() servlen argument is size_t' "-DGN_SERVLEN_T=size_t -DGN_FLAGS_T=int" \
|
||||
if ! check_compile 'whether getnameinfo() servlen argument is size_t' "-DGN_NODELEN_T=socklen_t -DGN_SERVLEN_T=size_t -DGN_FLAGS_T=int" \
|
||||
'#define _GNU_SOURCE\n#include <netdb.h>\nint getnameinfo(const struct sockaddr *, socklen_t, char *, socklen_t, char *, size_t, int);int main() {\nreturn 0;}' ; then
|
||||
fail "failed to detect getnameinfo signature"
|
||||
# FreeBSD
|
||||
if ! check_compile 'whether getnameinfo() servlen and nodelen argument is size_t' "-DGN_NODELEN_T=size_t -DGN_SERVLEN_T=size_t -DGN_FLAGS_T=int" \
|
||||
'#define _GNU_SOURCE\n#include <netdb.h>\nint getnameinfo(const struct sockaddr *, socklen_t, char *, size_t, char *, size_t, int);int main() {\nreturn 0;}' ; then
|
||||
fail "failed to detect getnameinfo signature"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -109,7 +109,7 @@ typedef int (*getaddrinfo_t)(const char *, const char *, const struct addrinfo *
|
|||
struct addrinfo **);
|
||||
|
||||
typedef int (*getnameinfo_t) (const struct sockaddr *, socklen_t, char *,
|
||||
socklen_t, char *, GN_SERVLEN_T, GN_FLAGS_T);
|
||||
GN_NODELEN_T, char *, GN_SERVLEN_T, GN_FLAGS_T);
|
||||
|
||||
typedef ssize_t (*sendto_t) (int sockfd, const void *buf, size_t len, int flags,
|
||||
const struct sockaddr *dest_addr, socklen_t addrlen);
|
||||
|
|
|
@ -729,7 +729,7 @@ HOOKFUNC(void, freeaddrinfo, struct addrinfo *res) {
|
|||
}
|
||||
|
||||
HOOKFUNC(int, getnameinfo, const struct sockaddr *sa, socklen_t salen,
|
||||
char *host, socklen_t hostlen, char *serv,
|
||||
char *host, GN_NODELEN_T hostlen, char *serv,
|
||||
GN_SERVLEN_T servlen, GN_FLAGS_T flags)
|
||||
{
|
||||
INIT();
|
||||
|
|
Loading…
Reference in New Issue