MSVC: use shipped headers instead of fallback definitions
VS2010 comes with stdint.h [1] VS2013 comes with inttypes.h [2] [1] https://stackoverflow.com/a/2628014/3906760 [2] https://blogs.msdn.microsoft.com/vcblog/2013/07/19/c99-library-support-in-visual-studio-2013/ Signed-off-by: Sven Strickroth <sven@cs-ware.de> Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Acked-by: Sebastian Schuberth <sschuberth@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Sven Strickroth committed
Mar 30, 2016 at 13:37 UTC
0ef60afdd4416345b16b5c4d8d0558a08d680bc5
2 files changed
+5
-1
compat/mingw.h
+1
-1
@@ -406,7 +406,7 @@ static inline void convert_slashes(char *path)
406
int mingw_offset_1st_component(const char *path);
407
#define offset_1st_component mingw_offset_1st_component
408
#define PATH_SEP ';'
409
-#ifndef __MINGW64_VERSION_MAJOR
409
+#if !defined(__MINGW64_VERSION_MAJOR) && (!defined(_MSC_VER) || _MSC_VER < 1800)
410
#define PRIuMAX "I64u"
411
#define PRId64 "I64d"
412
#else
compat/vcbuild/include/unistd.h
+4
@@ -45,11 +45,15 @@ typedef unsigned long long uintmax_t;
45
46
typedef int64_t off64_t;
47
48
+#if !defined(_MSC_VER) || _MSC_VER < 1600
49
#define INTMAX_MIN _I64_MIN
50
#define INTMAX_MAX _I64_MAX
51
#define UINTMAX_MAX _UI64_MAX
52
53
#define UINT32_MAX 0xffffffff /* 4294967295U */
54
+#else
55
+#include <stdint.h>
56
+#endif
57
58
#define STDIN_FILENO 0
59
#define STDOUT_FILENO 1