From: Ken Raeburn Date: Thu, 21 Aug 2003 07:25:45 +0000 (+0000) Subject: * fake-addrinfo.h (getnameinfo): Define to my_fake_getnameinfo only if X-Git-Tag: krb5-1.4-beta1~765 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=060ce771f6db5e1e92a717ab6b9b926b800d8e45;p=krb5.git * fake-addrinfo.h (getnameinfo): Define to my_fake_getnameinfo only if HAVE_GETADDRINFO is defined. ticket: 1380 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15784 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/include/ChangeLog b/src/include/ChangeLog index 1b650b9aa..032343014 100644 --- a/src/include/ChangeLog +++ b/src/include/ChangeLog @@ -1,3 +1,8 @@ +2003-08-21 Ken Raeburn + + * fake-addrinfo.h (getnameinfo): Define to my_fake_getnameinfo + only if HAVE_GETADDRINFO is defined. + 2003-08-20 Ken Raeburn * fake-addrinfo.h (inline): Move definitions further up, before diff --git a/src/include/fake-addrinfo.h b/src/include/fake-addrinfo.h index ded8745ac..431ec8223 100644 --- a/src/include/fake-addrinfo.h +++ b/src/include/fake-addrinfo.h @@ -324,6 +324,11 @@ system_freeaddrinfo (struct addrinfo *ai) freeaddrinfo(ai); } +/* Note: Implementations written to RFC 2133 use size_t, while RFC + 2553 implementations use socklen_t, for the second parameter. + + Mac OS X (10.2) and AIX 4.3.3 appear to be in the RFC 2133 camp, + but we don't have an autoconf test for that right now. */ static inline int system_getnameinfo (const struct sockaddr *sa, socklen_t salen, char *host, size_t hostlen, char *serv, size_t servlen, @@ -339,8 +344,6 @@ system_getnameinfo (const struct sockaddr *sa, socklen_t salen, #define getaddrinfo my_fake_getaddrinfo #undef freeaddrinfo #define freeaddrinfo my_fake_freeaddrinfo -#undef getnameinfo -#define getnameinfo my_fake_getnameinfo #endif @@ -538,14 +541,6 @@ void freeaddrinfo (struct addrinfo *ai); #endif -#if !defined (HAVE_GETADDRINFO) -static -int getnameinfo (const struct sockaddr *addr, socklen_t len, - char *host, socklen_t hostlen, - char *service, socklen_t servicelen, - int flags); -#endif - #if !defined (HAVE_GETADDRINFO) #define HAVE_FAKE_GETADDRINFO /* was not originally HAVE_GETADDRINFO */ @@ -554,11 +549,22 @@ int getnameinfo (const struct sockaddr *addr, socklen_t len, #undef HAVE_GETNAMEINFO #define HAVE_GETNAMEINFO 1 +#undef getnameinfo +#define getnameinfo my_fake_getnameinfo + static char *gai_strerror (int code); #endif +#if !defined (HAVE_GETADDRINFO) +static +int getnameinfo (const struct sockaddr *addr, socklen_t len, + char *host, socklen_t hostlen, + char *service, socklen_t servicelen, + int flags); +#endif + /* Fudge things on older gai implementations. */ /* AIX 4.3.3 is based on RFC 2133; no AI_NUMERICHOST. */ #ifndef AI_NUMERICHOST