* fake-addrinfo.h: Don't include netdb.h, since port-sockets.h already does.
authorKen Raeburn <raeburn@mit.edu>
Fri, 16 Jul 2004 21:12:30 +0000 (21:12 +0000)
committerKen Raeburn <raeburn@mit.edu>
Fri, 16 Jul 2004 21:12:30 +0000 (21:12 +0000)
* 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
src/include/fake-addrinfo.h
src/include/port-sockets.h

index 7f05b0638af00bf77f03364377fd164dbb4ec54b..30cccd96c431897ee03175d1ef338cb77df362d3 100644 (file)
@@ -1,5 +1,11 @@
 2004-07-16  Ken Raeburn  <raeburn@mit.edu>
 
+       * 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.
 
index e37dc6790336cd146411c1e779b930d2e692ca8d..f247e75ad64d4b8f467fd6998ddd04a2a9b0f96c 100644 (file)
@@ -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 <netdb.h>
-# undef _XOPEN_SOURCE_EXTENDED
-#endif
-
 #if defined(HAVE_FAKE_GETADDRINFO) || defined(FAI_CACHE)
 #define NEED_FAKE_GETADDRINFO
 #endif
index 09e3cfb41853dd6b571969c8bd246bb48ccffa2c..6e8ca47bf4b1629037e31f50db2d19f38dd80c94 100644 (file)
@@ -79,7 +79,16 @@ typedef WSABUF sg_buf;
 #include <sys/types.h>
 #include <netinet/in.h>                /* For struct sockaddr_in and in_addr */
 #include <arpa/inet.h>         /* For inet_ntoa */
-#include <netdb.h>             /* 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 <netdb.h>
+# undef _XOPEN_SOURCE_EXTENDED
+#else
+# include <netdb.h>
+#endif
+
 #include <sys/param.h>         /* For MAXHOSTNAMELEN */
 #include <sys/socket.h>                /* For SOCK_*, AF_*, etc */
 #include <sys/time.h>          /* For struct timeval */