Skip to content

Commit fcf3a21

Browse files
Gary V. Vaughangitster
authored andcommitted
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>
1 parent b2b0026 commit fcf3a21

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

git-compat-util.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ static inline const char *skip_prefix(const char *str, const char *prefix)
217217
#define PROT_READ 1
218218
#define PROT_WRITE 2
219219
#define MAP_PRIVATE 1
220-
#define MAP_FAILED ((void*)-1)
221220
#endif
222221

223222
#define mmap git_mmap
@@ -246,6 +245,10 @@ extern int git_munmap(void *start, size_t length);
246245

247246
#endif /* NO_MMAP */
248247

248+
#ifndef MAP_FAILED
249+
#define MAP_FAILED ((void *)-1)
250+
#endif
251+
249252
#ifdef NO_ST_BLOCKS_IN_STRUCT_STAT
250253
#define on_disk_bytes(st) ((st).st_size)
251254
#else

0 commit comments

Comments
 (0)