From: Sven Strickroth <sven@cs-ware.de>
To: Sebastian Schuberth <sschuberth@gmail.com>,
Git List <git@vger.kernel.org>,
Junio C Hamano <gitster@pobox.com>,
blees@dcon.de
Subject: Re: [PATCH 2/2 V3] MSVC: Use shipped headers instead of fallback definitions
Date: Wed, 30 Mar 2016 13:37:36 +0200 [thread overview]
Message-ID: <56FBBA80.8090908@cs-ware.de> (raw)
In-Reply-To: <56FB93B9.7090306@gmail.com>
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>
---
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 < 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
--
2.7.4.windows.1
next prev parent reply other threads:[~2016-03-30 11:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-29 16:27 [PATCH 2/2] MSVC: VS2013 comes with inttypes.h Sven Strickroth
2016-03-29 16:47 ` Junio C Hamano
2016-03-29 17:23 ` [PATCH 2/2 V2] " Sven Strickroth
2016-03-29 17:35 ` Junio C Hamano
2016-03-30 8:52 ` Sebastian Schuberth
2016-03-30 11:37 ` Sven Strickroth [this message]
2016-03-30 11:40 ` [PATCH 2/2 V3] MSVC: Use shipped headers instead of fallback definitions Sebastian Schuberth
2016-03-30 11:42 ` Johannes Schindelin
2016-03-30 18:19 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56FBBA80.8090908@cs-ware.de \
--to=sven@cs-ware.de \
--cc=blees@dcon.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=sschuberth@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).