From: Gary V. Vaughan Date: Tue, 16 Mar 2010 05:42:28 GMT Subject: [patch 08/15] host-HPUX10.patch Message-ID: <20100316054337.190506000@mlists.thewrittenword.com> In-Reply-To: <20100316054220.075676000@mlists.thewrittenword.com> HP-UX 10.20 has no PREAD, and while it does support mmap(), there is no system MAP_FAILED definition. --- Makefile | 1 + git-compat-util.h | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) Index: b/Makefile =================================================================== --- a/Makefile +++ b/Makefile @@ -929,6 +929,9 @@ ifeq ($(uname_S),HP-UX) NO_HSTRERROR = YesPlease NO_SYS_SELECT_H = YesPlease SNPRINTF_RETURNS_BOGUS = YesPlease + ifeq ($(uname_R),B.10.20) + NO_PREAD = YesPlease + endif GIT_TEST_CMP = cmp endif ifeq ($(uname_S),Windows) 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)