diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-11-20 23:48:11 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-11-20 23:48:11 -0800 |
commit | 7a4383cf13819cd2ef00f0d60318aad3f1813117 (patch) | |
tree | 7909507115206e773783940871aeb380df778d07 /compat | |
parent | Merge branch 'rj/maint-simplify-cygwin-makefile' (diff) | |
parent | MSVC: Add support for building with NO_MMAP (diff) | |
download | tgif-7a4383cf13819cd2ef00f0d60318aad3f1813117.tar.xz |
Merge branch 'rj/cygwin-msvc'
* rj/cygwin-msvc:
MSVC: Add support for building with NO_MMAP
Makefile: keep MSVC and Cygwin configuration separate
Diffstat (limited to 'compat')
-rw-r--r-- | compat/mingw.c | 12 | ||||
-rw-r--r-- | compat/mingw.h | 2 | ||||
-rw-r--r-- | compat/win32mmap.c | 12 |
3 files changed, 13 insertions, 13 deletions
diff --git a/compat/mingw.c b/compat/mingw.c index 6b5b5b2c70..15fe33eaa0 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -1000,6 +1000,18 @@ repeat: 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 6907345f90..51993ef114 100644 --- a/compat/mingw.h +++ b/compat/mingw.h @@ -187,7 +187,7 @@ int mingw_connect(int sockfd, struct sockaddr *sa, size_t sz); 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 779d796cd5..1c5a14922f 100644 --- a/compat/win32mmap.c +++ b/compat/win32mmap.c @@ -1,17 +1,5 @@ #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; |