summaryrefslogtreecommitdiffstats
path: root/src/include/port-sockets.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/port-sockets.h')
-rw-r--r--src/include/port-sockets.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/include/port-sockets.h b/src/include/port-sockets.h
index 09e3cfb418..6e8ca47bf4 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 */