summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-04-08 14:29:13 -0700
committerJunio C Hamano <gitster@pobox.com>2016-04-08 14:29:13 -0700
commit4af4612466ad26e2da8e03558487dd38b2ee68ba (patch)
tree31edc9805807e1f44f6ad9a2e7781dd48b7c3e4c
parentb0fbcf0003d87c050a55434eaf74a48ad78cb2a9 (diff)
parent0ef60afdd4416345b16b5c4d8d0558a08d680bc5 (diff)
downloadgit-4af4612466ad26e2da8e03558487dd38b2ee68ba.tar.gz
Merge branch 'ss/msvc'
Build updates for MSVC. * ss/msvc: MSVC: use shipped headers instead of fallback definitions MSVC: vsnprintf in Visual Studio 2015 doesn't need SNPRINTF_SIZE_CORR any more
-rw-r--r--compat/mingw.h2
-rw-r--r--compat/snprintf.c2
-rw-r--r--compat/vcbuild/include/unistd.h4
3 files changed, 6 insertions, 2 deletions
diff --git a/compat/mingw.h b/compat/mingw.h
index c008694639..1de70ffd62 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -406,7 +406,7 @@ static inline void convert_slashes(char *path)
int mingw_offset_1st_component(const char *path);
#define offset_1st_component mingw_offset_1st_component
#define PATH_SEP ';'
-#ifndef __MINGW64_VERSION_MAJOR
+#if !defined(__MINGW64_VERSION_MAJOR) && (!defined(_MSC_VER) || _MSC_VER < 1800)
#define PRIuMAX "I64u"
#define PRId64 "I64d"
#else
diff --git a/compat/snprintf.c b/compat/snprintf.c
index 42ea1ac110..0b11688537 100644
--- a/compat/snprintf.c
+++ b/compat/snprintf.c
@@ -9,7 +9,7 @@
* always have room for a trailing NUL byte.
*/
#ifndef SNPRINTF_SIZE_CORR
-#if defined(WIN32) && (!defined(__GNUC__) || __GNUC__ < 4)
+#if defined(WIN32) && (!defined(__GNUC__) || __GNUC__ < 4) && (!defined(_MSC_VER) || _MSC_VER < 1900)
#define SNPRINTF_SIZE_CORR 1
#else
#define SNPRINTF_SIZE_CORR 0
diff --git a/compat/vcbuild/include/unistd.h b/compat/vcbuild/include/unistd.h
index c65c2cd566..3a959d124c 100644
--- a/compat/vcbuild/include/unistd.h
+++ b/compat/vcbuild/include/unistd.h
@@ -45,11 +45,15 @@ typedef unsigned long long uintmax_t;
typedef int64_t off64_t;
+#if !defined(_MSC_VER) || _MSC_VER < 1600
#define INTMAX_MIN _I64_MIN
#define INTMAX_MAX _I64_MAX
#define UINTMAX_MAX _UI64_MAX
#define UINT32_MAX 0xffffffff /* 4294967295U */
+#else
+#include <stdint.h>
+#endif
#define STDIN_FILENO 0
#define STDOUT_FILENO 1