From 4a694e87361d08eff5c4c9e9f551b1a0d41f7c40 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Sun, 2 Apr 2017 15:26:06 -0700 Subject: 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. --- src/windows_port.h | 4 ++++ 1 file changed, 4 insertions(+) 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 +#else #define PRId32 "d" #define PRIu32 "u" #define PRId64 "I64d" #define PRIu64 "I64u" +#endif #if !defined(__MINGW32__) && !defined(__MINGW64__) #define strtoq _strtoi64 -- cgit v1.2.3