summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Germishuys <jacquesg@striata.com>2014-07-05 21:27:21 +0200
committerJacques Germishuys <jacquesg@striata.com>2014-07-06 09:22:24 +0200
commit72090514b14ef5d11828c960a905fe07ce68ae88 (patch)
tree3f40c85f0a0e55019433fbe2d5fb6d0269999954
parent491ad0de59e1002acf9919d84557345e964b9d06 (diff)
downloadlibgit2-72090514b14ef5d11828c960a905fe07ce68ae88.tar.gz
Secure CRT is only available from Visual Studio 2005+
-rw-r--r--src/win32/posix.h2
-rw-r--r--src/win32/posix_w32.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/win32/posix.h b/src/win32/posix.h
index 2cbea1807..22ea6a531 100644
--- a/src/win32/posix.h
+++ b/src/win32/posix.h
@@ -19,7 +19,7 @@
# define EAFNOSUPPORT (INT_MAX-1)
#endif
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && _MSC_VER >= 1500
# define p_ftruncate(fd, sz) _chsize_s(fd, sz)
#else /* MinGW */
# define p_ftruncate(fd, sz) _chsize(fd, sz)
diff --git a/src/win32/posix_w32.c b/src/win32/posix_w32.c
index fbadb1c9e..fb8246558 100644
--- a/src/win32/posix_w32.c
+++ b/src/win32/posix_w32.c
@@ -543,7 +543,7 @@ char *p_realpath(const char *orig_path, char *buffer)
int p_vsnprintf(char *buffer, size_t count, const char *format, va_list argptr)
{
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && _MSC_VER >= 1500
int len;
if (count == 0 ||
@@ -570,7 +570,7 @@ int p_snprintf(char *buffer, size_t count, const char *format, ...)
int p_mkstemp(char *tmp_path)
{
-#if defined(_MSC_VER)
+#if defined(_MSC_VER) && _MSC_VER >= 1500
if (_mktemp_s(tmp_path, strlen(tmp_path) + 1) != 0)
return -1;
#else