git-compat-util.h: some platforms with mmap() lack MAP_FAILED definition
[gitweb.git] / git-compat-util.h
index 7e62b552700a580646dbb6a8921c40761d6b57a2..cd3022e99f820074feb33d3ee55c75f0534b31b8 100644 (file)
@@ -217,7 +217,6 @@ static inline const char *skip_prefix(const char *str, const char *prefix)
 #define PROT_READ 1
 #define PROT_WRITE 2
 #define MAP_PRIVATE 1
-#define MAP_FAILED ((void*)-1)
 #endif
 
 #define mmap git_mmap
@@ -246,6 +245,10 @@ extern int git_munmap(void *start, size_t length);
 
 #endif /* NO_MMAP */
 
+#ifndef MAP_FAILED
+#define MAP_FAILED ((void *)-1)
+#endif
+
 #ifdef NO_ST_BLOCKS_IN_STRUCT_STAT
 #define on_disk_bytes(st) ((st).st_size)
 #else