From d854ba33a385e428ad8a2ec0bbb4c79a7afbdf58 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Fri, 16 Jul 2004 21:12:30 +0000 Subject: [PATCH] * fake-addrinfo.h: Don't include netdb.h, since port-sockets.h already does. * port-sockets.h: Define _XOPEN_SOURCE_EXTENDED around inclusion of netdb.h if it's not defined and not Windows, as fake-addrinfo.h used to do; otherwise just include it normally. ticket: 2379 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16608 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/ChangeLog | 6 ++++++ src/include/fake-addrinfo.h | 7 ------- src/include/port-sockets.h | 11 ++++++++++- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/include/ChangeLog b/src/include/ChangeLog index 7f05b0638..30cccd96c 100644 --- a/src/include/ChangeLog +++ b/src/include/ChangeLog @@ -1,5 +1,11 @@ 2004-07-16 Ken Raeburn + * fake-addrinfo.h: Don't include netdb.h, since port-sockets.h + already does. + * port-sockets.h: Define _XOPEN_SOURCE_EXTENDED around inclusion + of netdb.h if it's not defined and not Windows, as fake-addrinfo.h + used to do; otherwise just include it normally. + * port-sockets.h (inet_ntop): Cast NULL to desired return pointer type. diff --git a/src/include/fake-addrinfo.h b/src/include/fake-addrinfo.h index e37dc6790..f247e75ad 100644 --- a/src/include/fake-addrinfo.h +++ b/src/include/fake-addrinfo.h @@ -561,13 +561,6 @@ int getnameinfo (const struct sockaddr *addr, socklen_t len, # define AI_NUMERICHOST 0 #endif -#if !defined(_XOPEN_SOURCE_EXTENDED) && !defined(HAVE_MACSOCK_H) && !defined(_WIN32) -/* Hack for HPUX, to get h_errno. */ -# define _XOPEN_SOURCE_EXTENDED 1 -# include -# undef _XOPEN_SOURCE_EXTENDED -#endif - #if defined(HAVE_FAKE_GETADDRINFO) || defined(FAI_CACHE) #define NEED_FAKE_GETADDRINFO #endif diff --git a/src/include/port-sockets.h b/src/include/port-sockets.h index 09e3cfb41..6e8ca47bf 100644 --- a/src/include/port-sockets.h +++ b/src/include/port-sockets.h @@ -79,7 +79,16 @@ typedef WSABUF sg_buf; #include #include /* For struct sockaddr_in and in_addr */ #include /* For inet_ntoa */ -#include /* For struct hostent, gethostbyname, etc */ + +#if !defined(_XOPEN_SOURCE_EXTENDED) && !defined(HAVE_MACSOCK_H) && !defined(_WIN32) +/* Hack for HPUX, to get h_errno. */ +# define _XOPEN_SOURCE_EXTENDED 1 +# include +# undef _XOPEN_SOURCE_EXTENDED +#else +# include +#endif + #include /* For MAXHOSTNAMELEN */ #include /* For SOCK_*, AF_*, etc */ #include /* For struct timeval */ -- 2.26.2