Skip to content

Commit 0ef60af

Browse files
Sven Strickrothgitster
authored andcommitted
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 <[email protected]> Acked-by: Johannes Schindelin <[email protected]> Acked-by: Sebastian Schuberth <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent dae26d3 commit 0ef60af

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

compat/mingw.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ static inline void convert_slashes(char *path)
406406
int mingw_offset_1st_component(const char *path);
407407
#define offset_1st_component mingw_offset_1st_component
408408
#define PATH_SEP ';'
409-
#ifndef __MINGW64_VERSION_MAJOR
409+
#if !defined(__MINGW64_VERSION_MAJOR) && (!defined(_MSC_VER) || _MSC_VER < 1800)
410410
#define PRIuMAX "I64u"
411411
#define PRId64 "I64d"
412412
#else

compat/vcbuild/include/unistd.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,15 @@ typedef unsigned long long uintmax_t;
4545

4646
typedef int64_t off64_t;
4747

48+
#if !defined(_MSC_VER) || _MSC_VER < 1600
4849
#define INTMAX_MIN _I64_MIN
4950
#define INTMAX_MAX _I64_MAX
5051
#define UINTMAX_MAX _UI64_MAX
5152

5253
#define UINT32_MAX 0xffffffff /* 4294967295U */
54+
#else
55+
#include <stdint.h>
56+
#endif
5357

5458
#define STDIN_FILENO 0
5559
#define STDOUT_FILENO 1

0 commit comments

Comments
 (0)