summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Vanik <ben.vanik@gmail.com>2017-04-02 15:26:06 -0700
committerAndreas Schuh <andreas.schuh.84@gmail.com>2017-05-16 11:37:59 +0100
commit4a694e87361d08eff5c4c9e9f551b1a0d41f7c40 (patch)
tree8c7269e21f7f50c74f93d170870ac1082afcf244
parent21c7bcd895ac296e5395503b590bc74ceb0520a8 (diff)
downloadgflags-4a694e87361d08eff5c4c9e9f551b1a0d41f7c40.tar.gz
gflags-4a694e87361d08eff5c4c9e9f551b1a0d41f7c40.tar.bz2
gflags-4a694e87361d08eff5c4c9e9f551b1a0d41f7c40.zip
Use inttypes.h on VC++ 2013 and up
Warnings will spit out on newer compilers due to PRI* being redefined. Tested with VC++ 2015 and 2017. [Blog post](https://blogs.msdn.microsoft.com/vcblog/2013/07/19/c99-library-support-in-visual-studio-2013/) describing the defines being added in 2013.
-rw-r--r--src/windows_port.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/windows_port.h b/src/windows_port.h
index 554b9c9..61cf5b7 100644
--- a/src/windows_port.h
+++ b/src/windows_port.h
@@ -109,10 +109,14 @@ inline void setenv(const char* name, const char* value, int) {
#define unlink _unlink
#endif
+#if defined(_MSC_VER) && _MSC_VER >= 1800
+#include <inttypes.h>
+#else
#define PRId32 "d"
#define PRIu32 "u"
#define PRId64 "I64d"
#define PRIu64 "I64u"
+#endif
#if !defined(__MINGW32__) && !defined(__MINGW64__)
#define strtoq _strtoi64