summaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorGary V. Vaughan <git@mlists.thewrittenword.com>2010-05-14 09:31:39 +0000
committerJunio C Hamano <gitster@pobox.com>2010-05-31 17:36:27 -0700
commitfcf3a21acce45aa73001ee1d3ae119f653294def (patch)
treeb93345392f6ee592fae38cc124c85b825e18b1f3 /git-compat-util.h
parentb2b0026eede10894d3317920a277b2a579cd86c5 (diff)
downloadgit-fcf3a21acce45aa73001ee1d3ae119f653294def.tar.gz
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>
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index 7e62b55270..cd3022e99f 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -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