--- a/src/metatile.h
+++ b/src/metatile.h
@@ -26,3 +26,7 @@
 int xyz_to_meta(char *path, size_t len, const char *dir, int x, int y, int z);
 
 int metatile_read(const char *dir, int x, int y, int z, char *buf, size_t sz, int * compressed, char * log_msg);
+
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
