Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Junio C Hamano committed Apr 8, 2016
2 parents b0fbcf0 + 0ef60af commit 4af4612
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compat/mingw.h
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion compat/snprintf.c
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions compat/vcbuild/include/unistd.h
Expand Up @@ -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
Expand Down

0 comments on commit 4af4612

Please sign in to comment.