summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2004-07-16 21:12:30 +0000
committerKen Raeburn <raeburn@mit.edu>2004-07-16 21:12:30 +0000
commitd854ba33a385e428ad8a2ec0bbb4c79a7afbdf58 (patch)
tree38f0399955808db6cb8c838a4e48dbab5f78ee82
parentb9425d8f98d395095a7cf98d4a7408b8cd844998 (diff)
downloadkrb5-d854ba33a385e428ad8a2ec0bbb4c79a7afbdf58.tar.gz
krb5-d854ba33a385e428ad8a2ec0bbb4c79a7afbdf58.tar.xz
krb5-d854ba33a385e428ad8a2ec0bbb4c79a7afbdf58.zip
* 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
-rw-r--r--src/include/ChangeLog6
-rw-r--r--src/include/fake-addrinfo.h7
-rw-r--r--src/include/port-sockets.h11
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 <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.
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 <netdb.h>
-# 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 <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 */