@matheusbsbs / matheus-bagliano / commits / fcf3a21acc
Fork 0

git-compat-util.h: some platforms with mmap() lack MAP_FAILED definition

Some platforms with mmap() lack MAP_FAILED definition. Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Gary V. Vaughan committed May 14, 2010 at 09:31 UTC fcf3a21acce45aa73001ee1d3ae119f653294def
1 file changed +4 -1
git-compat-util.h
+4 -1
@@ -217,7 +217,6 @@ static inline const char *skip_prefix(const char *str, const char *prefix)
217 #define PROT_READ 1
218 #define PROT_WRITE 2
219 #define MAP_PRIVATE 1
220 -#define MAP_FAILED ((void*)-1)
220 #endif
221
222 #define mmap git_mmap
@@ -246,6 +245,10 @@ extern int git_munmap(void *start, size_t length);
245
246 #endif /* NO_MMAP */
247
248 +#ifndef MAP_FAILED
249 +#define MAP_FAILED ((void *)-1)
250 +#endif
251 +
252 #ifdef NO_ST_BLOCKS_IN_STRUCT_STAT
253 #define on_disk_bytes(st) ((st).st_size)
254 #else