From b41c851312876dbf146fb674265b86c72ed611ab Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 1 Feb 2017 22:10:45 +0100 Subject: fixdep: fix assumption that `long` is as large as `void *` It is not. At least not in general. And in particular not on 64-bit Windows, where sizeof(long) == 4. What the code wanted to use is actually called intptr_t. Note: `intptr_t` is a C99 feature. Signed-off-by: Johannes Schindelin --- scripts/basic/fixdep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/basic') diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index d3aa4e390..9f461a65b 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c @@ -353,7 +353,7 @@ void do_config_file(char *filename) return; } map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); - if ((long) map == -1) { + if ((intptr_t) map == -1) { perror("fixdep: mmap"); close(fd); return; @@ -428,7 +428,7 @@ void print_deps(void) return; } map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); - if ((long) map == -1) { + if ((intptr_t) map == -1) { perror("fixdep: mmap"); close(fd); return; -- cgit v1.2.3-55-g6feb