summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d691d84)
raw | patch | inline | side by side (parent: d691d84)
author | Ramsay Jones <ramsay@ramsay1.demon.co.uk> | |
Sat, 7 Nov 2009 20:10:31 +0000 (20:10 +0000) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 9 Nov 2009 01:59:12 +0000 (17:59 -0800) |
When the NO_MMAP build variable is set, the msvc linker complains:
error LNK2001: unresolved external symbol _getpagesize
The msvc libraries do not define the getpagesize() function,
so we move the mingw_getpagesize() implementation from the
conditionally built win32mmap.c file to mingw.c.
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
error LNK2001: unresolved external symbol _getpagesize
The msvc libraries do not define the getpagesize() function,
so we move the mingw_getpagesize() implementation from the
conditionally built win32mmap.c file to mingw.c.
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/mingw.c | patch | blob | history | |
compat/mingw.h | patch | blob | history | |
compat/win32mmap.c | patch | blob | history |
diff --git a/compat/mingw.c b/compat/mingw.c
index 6b5b5b2c7011a89c0415ebb89406c4a3ac53e9a9..15fe33eaa0f220e94131006bca89effd14d6d058 100644 (file)
--- a/compat/mingw.c
+++ b/compat/mingw.c
return -1;
}
+/*
+ * Note that this doesn't return the actual pagesize, but
+ * the allocation granularity. If future Windows specific git code
+ * needs the real getpagesize function, we need to find another solution.
+ */
+int mingw_getpagesize(void)
+{
+ SYSTEM_INFO si;
+ GetSystemInfo(&si);
+ return si.dwAllocationGranularity;
+}
+
struct passwd *getpwuid(int uid)
{
static char user_name[100];
diff --git a/compat/mingw.h b/compat/mingw.h
index 5b5258bcebbbead7e4ed15a4dea7bf755739b98e..26c402733e1171179424b8188235c1b82be25ca8 100644 (file)
--- a/compat/mingw.h
+++ b/compat/mingw.h
int mingw_rename(const char*, const char*);
#define rename mingw_rename
-#ifdef USE_WIN32_MMAP
+#if defined(USE_WIN32_MMAP) || defined(_MSC_VER)
int mingw_getpagesize(void);
#define getpagesize mingw_getpagesize
#endif
diff --git a/compat/win32mmap.c b/compat/win32mmap.c
index 779d796cd5f017d4effbede360185a4690cf414e..1c5a14922f255af2c3b0e75e06925b748d3d7684 100644 (file)
--- a/compat/win32mmap.c
+++ b/compat/win32mmap.c
#include "../git-compat-util.h"
-/*
- * Note that this doesn't return the actual pagesize, but
- * the allocation granularity. If future Windows specific git code
- * needs the real getpagesize function, we need to find another solution.
- */
-int mingw_getpagesize(void)
-{
- SYSTEM_INFO si;
- GetSystemInfo(&si);
- return si.dwAllocationGranularity;
-}
-
void *git_mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset)
{
HANDLE hmap;