Skip to content

Commit 4af4612

Browse files
committed
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
2 parents b0fbcf0 + 0ef60af commit 4af4612

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
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/snprintf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* always have room for a trailing NUL byte.
1010
*/
1111
#ifndef SNPRINTF_SIZE_CORR
12-
#if defined(WIN32) && (!defined(__GNUC__) || __GNUC__ < 4)
12+
#if defined(WIN32) && (!defined(__GNUC__) || __GNUC__ < 4) && (!defined(_MSC_VER) || _MSC_VER < 1900)
1313
#define SNPRINTF_SIZE_CORR 1
1414
#else
1515
#define SNPRINTF_SIZE_CORR 0

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)