diff --git a/fileio.c b/fileio.c
index 4bb1f46..c937eb0 100644
--- a/fileio.c
+++ b/fileio.c
@@ -27,6 +27,14 @@
 #include "kbd.h"
 #include "pathnames.h"
 
+#ifndef MAXNAMLEN
+#define MAXNAMLEN 255
+#endif
+
+#ifndef DEFFILEMODE
+#define DEFFILEMODE 0666
+#endif
+
 static char *bkuplocation(const char *);
 static int   bkupleavetmp(const char *);
 
diff --git a/re_search.c b/re_search.c
index 287030a..da44f00 100644
--- a/re_search.c
+++ b/re_search.c
@@ -34,6 +34,10 @@
 #define RE_NMATCH	10		/* max number of matches	    */
 #define REPLEN		256		/* max length of replacement string */
 
+#ifndef REG_STARTEND
+#define REG_STARTEND 4
+#endif
+
 char	re_pat[NPAT];			/* regex pattern		    */
 int	re_srch_lastdir = SRCH_NOPR;	/* last search flags		    */
 int	casefoldsearch = TRUE;		/* does search ignore case?	    */
