summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2015-03-09 09:18:37 -0400
committerEdward Thomson <ethomson@edwardthomson.com>2015-03-09 09:18:37 -0400
commit959482e104261286ea31f261d6694424b330938b (patch)
tree8bce9ebd55a60854b08421173d8cf52e1863fed1 /src
parentd77a4f943e827e44c73acbdbb7462489feaeeedf (diff)
parent78c34af016dc69e7553e671ad3795ffb9dbb93ef (diff)
downloadlibgit2-959482e104261286ea31f261d6694424b330938b.tar.gz
Merge pull request #2946 from tkelman/appveyor-mingw
RFC: add mingw to appveyor matrix
Diffstat (limited to 'src')
-rw-r--r--src/win32/mingw-compat.h7
-rw-r--r--src/win32/msvc-compat.h3
-rw-r--r--src/win32/posix.h2
-rw-r--r--src/win32/posix_w32.c2
4 files changed, 11 insertions, 3 deletions
diff --git a/src/win32/mingw-compat.h b/src/win32/mingw-compat.h
index feedfecf4..a4a5a31c7 100644
--- a/src/win32/mingw-compat.h
+++ b/src/win32/mingw-compat.h
@@ -17,6 +17,13 @@
#define stat _stati64
#endif
+#if _WIN32_WINNT < 0x0600 && !defined(__MINGW64_VERSION_MAJOR)
+#undef MemoryBarrier
+void __mingworg_MemoryBarrier(void);
+#define MemoryBarrier __mingworg_MemoryBarrier
+#define VOLUME_NAME_DOS 0x0
+#endif
+
#endif
#endif /* INCLUDE_mingw_compat__ */
diff --git a/src/win32/msvc-compat.h b/src/win32/msvc-compat.h
index 4789d63df..8004bc1f8 100644
--- a/src/win32/msvc-compat.h
+++ b/src/win32/msvc-compat.h
@@ -15,6 +15,9 @@
typedef unsigned short mode_t;
typedef SSIZE_T ssize_t;
+#define strcasecmp(s1, s2) _stricmp(s1, s2)
+#define strncasecmp(s1, s2, c) _strnicmp(s1, s2, c)
+
#endif
#define GIT_STDLIB_CALL __cdecl
diff --git a/src/win32/posix.h b/src/win32/posix.h
index 9ac78430b..4bc6bfe2e 100644
--- a/src/win32/posix.h
+++ b/src/win32/posix.h
@@ -32,8 +32,6 @@ extern int p_recv(GIT_SOCKET socket, void *buffer, size_t length, int flags);
extern int p_send(GIT_SOCKET socket, const void *buffer, size_t length, int flags);
extern int p_inet_pton(int af, const char* src, void* dst);
-#define strcasecmp(s1, s2) _stricmp(s1, s2)
-#define strncasecmp(s1, s2, c) _strnicmp(s1, s2, c)
extern int p_vsnprintf(char *buffer, size_t count, const char *format, va_list argptr);
extern int p_snprintf(char *buffer, size_t count, const char *format, ...) GIT_FORMAT_PRINTF(3, 4);
extern int p_mkstemp(char *tmp_path);
diff --git a/src/win32/posix_w32.c b/src/win32/posix_w32.c
index b8b4f43f8..544b1ebd5 100644
--- a/src/win32/posix_w32.c
+++ b/src/win32/posix_w32.c
@@ -55,7 +55,7 @@ int p_ftruncate(int fd, git_off_t size)
return -1;
}
-#if !defined(__MINGW32__)
+#if !defined(__MINGW32__) || defined(MINGW_HAS_SECURE_API)
return ((_chsize_s(fd, size) == 0) ? 0 : -1);
#else
/* TODO MINGW32 Find a replacement for _chsize() that handles big files. */