From 86c2afb1b1b760f93b730f68e7c4b0c0af924f57 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Thu, 21 Aug 2003 03:55:53 +0000 Subject: [PATCH] Make things work on IRIX again * fake-addrinfo.h (inline): Move definitions further up, before first use. Do use __inline__ for gcc without c99 support. (GET_SERV_BY_NAME) [!GETSERVBYNAME_R_RETURNS_INT]: Fix invocation for IRIX definition. * socket-utils.h: Include port-sockets.h to get a definition for struct sockaddr_storage. ticket: 1380 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15783 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/ChangeLog | 7 +++++++ src/include/fake-addrinfo.h | 29 +++++++++++++++-------------- src/include/socket-utils.h | 2 ++ 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/src/include/ChangeLog b/src/include/ChangeLog index 853ed01ea..1b650b9aa 100644 --- a/src/include/ChangeLog +++ b/src/include/ChangeLog @@ -1,5 +1,12 @@ 2003-08-20 Ken Raeburn + * fake-addrinfo.h (inline): Move definitions further up, before + first use. Do use __inline__ for gcc without c99 support. + (GET_SERV_BY_NAME) [!GETSERVBYNAME_R_RETURNS_INT]: Fix invocation + for IRIX definition. + * socket-utils.h: Include port-sockets.h to get a definition for + struct sockaddr_storage. + First cut at adding local caching to the getaddrinfo support. Still needs work. * fake-addrinfo.h: Delete the unused WRAP_GETNAMEINFO support. diff --git a/src/include/fake-addrinfo.h b/src/include/fake-addrinfo.h index 19c212ab2..ded8745ac 100644 --- a/src/include/fake-addrinfo.h +++ b/src/include/fake-addrinfo.h @@ -102,6 +102,19 @@ #include "port-sockets.h" #include "socket-utils.h" +#if !defined(inline) +# if __STDC_VERSION__ >= 199901L +/* C99 supports inline, don't do anything. */ +# elif defined(__GNUC__) +# define inline __inline__ /* this form silences -pedantic warnings */ +# elif defined(__mips) && defined(__sgi) +# define inline __inline /* IRIX used at MIT does inline but not c99 yet */ +# else +# define inline /* nothing, just static */ +# endif +# define ADDRINFO_UNDEF_INLINE +#endif + #ifdef S_SPLINT_S /*@-incondefs@*/ extern int @@ -277,11 +290,10 @@ extern /*@dependent@*/ char *gai_strerror (int code) /*@*/; #define GET_SERV_BY_NAME(NAME, PROTO, SP, ERR) \ { \ struct servent my_s_ent; \ - int my_s_err; \ char my_s_buf[8192]; \ (SP) = getservbyname_r((NAME), (PROTO), &my_s_ent, \ - my_s_buf, sizeof (my_s_buf), &my_s_err); \ - (ERR) = my_s_err; \ + my_s_buf, sizeof (my_s_buf)); \ + (ERR) = (SP) == NULL; \ } #define GET_SERV_BY_PORT(PORT, PROTO, SP, ERR) \ @@ -553,17 +565,6 @@ char *gai_strerror (int code); # define AI_NUMERICHOST 0 #endif -#if !defined(inline) -# if __STDC_VERSION__ >= 199901L || defined(__GNUC__) -/* C99 and GCC support inline, don't do anything. */ -# elif defined(__mips) && defined(__sgi) -# define inline __inline /* IRIX used at MIT does inline but not c99 yet */ -# else -# define inline /* nothing, just static */ -# endif -# define ADDRINFO_UNDEF_INLINE -#endif - #if !defined(_XOPEN_SOURCE_EXTENDED) && !defined(HAVE_MACSOCK_H) && !defined(_WIN32) /* Hack for HPUX, to get h_errno. */ # define _XOPEN_SOURCE_EXTENDED 1 diff --git a/src/include/socket-utils.h b/src/include/socket-utils.h index e5ea8f8a9..62c4d070c 100644 --- a/src/include/socket-utils.h +++ b/src/include/socket-utils.h @@ -52,6 +52,8 @@ /* for HAVE_SOCKLEN_T, KRB5_USE_INET6, etc */ #include "krb5/autoconf.h" +/* for sockaddr_storage */ +#include "port-sockets.h" #if defined (__GNUC__) /* -- 2.26.2