From 79945a0cdba5e7c5bd647c43831136edc63a60e5 Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sun, 9 Aug 2015 20:58:48 +0200 Subject: -Fix: [Win32] Compilation with MSVC2015. --- src/music/dmusic.cpp | 1 + src/os/windows/crashlog_win.cpp | 2 ++ src/stdafx.h | 4 +++- src/strgen/strgen_base.cpp | 2 +- src/string.cpp | 2 +- 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/music/dmusic.cpp b/src/music/dmusic.cpp index 40ce69d..de3bda8 100644 --- a/src/music/dmusic.cpp +++ b/src/music/dmusic.cpp @@ -22,6 +22,7 @@ #include "dmusic.h" #include +#undef FACILITY_DIRECTMUSIC // Needed for newer Windows SDK version. #include #include #include diff --git a/src/os/windows/crashlog_win.cpp b/src/os/windows/crashlog_win.cpp index 6e28cdb..1abb0e7 100644 --- a/src/os/windows/crashlog_win.cpp +++ b/src/os/windows/crashlog_win.cpp @@ -322,7 +322,9 @@ static char *PrintModuleInfo(char *output, const char *last, HMODULE mod) } #if defined(_MSC_VER) +#pragma warning(disable:4091) #include +#pragma warning(default:4091) char *CrashLogWindows::AppendDecodedStacktrace(char *buffer, const char *last) const { diff --git a/src/stdafx.h b/src/stdafx.h index d68605c..4616212 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -223,7 +223,9 @@ #include // alloca() #define NORETURN __declspec(noreturn) - #define inline __forceinline + #if (_MSC_VER < 1900) + #define inline __forceinline + #endif #if !defined(WINCE) #define CDECL _cdecl diff --git a/src/strgen/strgen_base.cpp b/src/strgen/strgen_base.cpp index c41f3d9..385ca72 100644 --- a/src/strgen/strgen_base.cpp +++ b/src/strgen/strgen_base.cpp @@ -378,7 +378,7 @@ static int TranslateArgumentIdx(int arg, int offset = 0); static void EmitWordList(Buffer *buffer, const char * const *words, uint nw) { buffer->AppendByte(nw); - for (uint i = 0; i < nw; i++) buffer->AppendByte((uint)strlen(words[i]) + 1); + for (uint i = 0; i < nw; i++) buffer->AppendByte((byte)strlen(words[i]) + 1); for (uint i = 0; i < nw; i++) { for (uint j = 0; words[i][j] != '\0'; j++) buffer->AppendByte(words[i][j]); buffer->AppendByte(0); diff --git a/src/string.cpp b/src/string.cpp index fd422ec..6306e6f 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -349,7 +349,7 @@ bool IsValidChar(WChar key, CharSetFilter afilter) } #ifdef WIN32 -#ifdef _MSC_VER +#if defined(_MSC_VER) && _MSC_VER < 1900 /** * Almost POSIX compliant implementation of \c vsnprintf for VC compiler. * The difference is in the value returned on output truncation. This -- 2.4.5