Merge pull request #2303 from jacquesg/mingw-lseek WIP: Windows fixes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
diff --git a/src/attrcache.c b/src/attrcache.c
index 56c028e..b4579bf 100644
--- a/src/attrcache.c
+++ b/src/attrcache.c
@@ -53,7 +53,7 @@ int git_attr_cache__alloc_file_entry(
cachesize++;
}
- ce = git_pool_mallocz(pool, cachesize);
+ ce = git_pool_mallocz(pool, (uint32_t)cachesize);
GITERR_CHECK_ALLOC(ce);
if (baselen) {
diff --git a/src/global.c b/src/global.c
index 4dfdcf4..7da3185 100644
--- a/src/global.c
+++ b/src/global.c
@@ -76,7 +76,7 @@ static void git__shutdown(void)
#if defined(GIT_THREADS) && defined(GIT_WIN32)
static DWORD _tls_index;
-static DWORD _mutex = 0;
+static volatile LONG _mutex = 0;
static int synchronized_threads_init()
{
diff --git a/src/win32/mingw-compat.h b/src/win32/mingw-compat.h
index 8f51d6f..059e39c 100644
--- a/src/win32/mingw-compat.h
+++ b/src/win32/mingw-compat.h
@@ -10,6 +10,7 @@
#if defined(__MINGW32__)
/* use a 64-bit file offset type */
+# undef lseek
# define lseek _lseeki64
# undef stat
# define stat _stati64