--- a/src/getsdir.h
+++ b/src/getsdir.h
@@ -24,6 +24,10 @@
 
 #include <dirent.h>
 
+#ifndef MAXNAMLEN
+#define MAXNAMLEN 255
+#endif
+
 typedef struct dirEntry {		/* structure of data item */
   char fname[MAXNAMLEN + 1];		/* filename + terminating null */
   time_t time;				/* last modification date */