--- a/master/master.c
+++ b/master/master.c
@@ -72,6 +72,10 @@
 #include <errno.h>
 #include <limits.h>
 
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
 #ifndef INADDR_NONE
 #define INADDR_NONE 0xffffffff
 #endif
--- a/master/service.c
+++ b/master/service.c
@@ -76,6 +76,10 @@
 #include "xstrlcat.h"
 #include "signals.h"
 
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
 extern int optind, opterr;
 extern char *optarg;
 
--- a/imap/pop3d.c
+++ b/imap/pop3d.c
@@ -94,6 +94,10 @@
 #include "sync_log.h"
 #include "statuscache.h"
 
+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN
+#endif
+
 #ifdef HAVE_KRB
 /* kerberos des is purported to conflict with OpenSSL DES */
 #define DES_DEFS
--- a/syslog/syslogd.c
+++ b/syslog/syslogd.c
@@ -156,6 +156,10 @@ static char sccsid[] = "@(#)syslogd.c	5.
 #include <ctype.h>
 #include <string.h>
 
+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN 255
+#endif
+
 #define SYSLOG_NAMES
 #include "syslog.h"
 
