--- a/src/tcp.c
+++ b/src/tcp.c
@@ -49,6 +49,9 @@ extern char *inet_ntoa(struct in_addr);
 extern int inet_aton(const char *, struct in_addr *);
 extern int h_errno;
 #define setErrnoNT()
+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN 256
+#endif
 #endif /* Unix or NT */
 
 #include "tcp.h"
