Thread (31 messages) flat view 31 messages, 5 authors, 2016-06-15
STALE3730d

[PATCH v5 08/18] git-compat-util.h: some platforms with mmap() lack MAP_FAILED definition

From: Gary V. Vaughan <hidden>
Date: 2016-06-15 22:48:48

Some platforms with mmap() lack MAP_FAILED definition.

Signed-off-by: Gary V. Vaughan <redacted>
---
 git-compat-util.h |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Index: b/git-compat-util.h
===================================================================
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -217,7 +217,6 @@ static inline const char *skip_prefix(co
 #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_
 
 #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
-- 
Gary V. Vaughan (gary@thewrittenword.com)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help