git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2 V2] MSVC: VS2013 comes with inttypes.h

From
SSSven Strickroth <sven@cs-ware.de>
Date
Mar 29, 2016, 17:23 UTC
Message-ID
<56FAB9FD.7080409@cs-ware.de>
In-Reply-To
<56FAACD4.9080504@cs-ware.de>
Signed-off-by: Sven Strickroth <email@cs-ware.de>
---
 compat/mingw.h                  | 2 +-
 compat/vcbuild/include/unistd.h | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/compat/mingw.h b/compat/mingw.h
index 6b6d695..137f42e 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -415,7 +415,7 @@ int mingw_offset_1st_component(const char *path);
 extern void build_libgit_environment(void);
 extern const char *program_data_config(void);
 #define git_program_data_config program_data_config
-#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/vcbuild/include/unistd.h b/compat/vcbuild/include/unistd.h
index c65c2cd..b7cc48c 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 < 1800
 #define INTMAX_MIN  _I64_MIN
 #define INTMAX_MAX  _I64_MAX
 #define UINTMAX_MAX _UI64_MAX
 
 #define UINT32_MAX 0xffffffff  /* 4294967295U */
+#else
+#include<inttypes.h>
+#endif
 
 #define STDIN_FILENO  0
 #define STDOUT_FILENO 1
-- 
2.7.4.windows.1
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 9 in “MSVC: VS2013 comes with inttypes.h”
  1. 2/2 MSVC: VS2013 comes with inttypes.hSven Strickroth, Mar 29, 2016
  2. Junio C HamanoMar 29, 2016
  3. Sven StrickrothMar 29, 2016
  4. Junio C HamanoMar 29, 2016
  5. Sebastian SchuberthMar 30, 2016
  6. Sven StrickrothMar 30, 2016
  7. Sebastian SchuberthMar 30, 2016
  8. Johannes SchindelinMar 30, 2016
  9. Junio C HamanoMar 30, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.