summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2015-08-10 20:21:29 +0000
committermichi_cc <michi_cc@openttd.org>2015-08-10 20:21:29 +0000
commit35b77450f80580da2aa7f087aa2a1631b92ebd62 (patch)
tree375c4648c1566b3cfc715e894764fdd26763e162
parente5d105900ddcb82bc2adf7accb4be010e3b20113 (diff)
downloadopenttd-35b77450f80580da2aa7f087aa2a1631b92ebd62.tar.xz
(svn r27380) -Fix: [Win32] Compilation with MSVC2015.
-rw-r--r--src/music/dmusic.cpp1
-rw-r--r--src/os/windows/crashlog_win.cpp2
-rw-r--r--src/stdafx.h4
-rw-r--r--src/strgen/strgen_base.cpp2
-rw-r--r--src/string.cpp2
5 files changed, 8 insertions, 3 deletions
diff --git a/src/music/dmusic.cpp b/src/music/dmusic.cpp
index 40ce69d1a..de3bda843 100644
--- a/src/music/dmusic.cpp
+++ b/src/music/dmusic.cpp
@@ -22,6 +22,7 @@
#include "dmusic.h"
#include <windows.h>
+#undef FACILITY_DIRECTMUSIC // Needed for newer Windows SDK version.
#include <dmksctrl.h>
#include <dmusici.h>
#include <dmusicc.h>
diff --git a/src/os/windows/crashlog_win.cpp b/src/os/windows/crashlog_win.cpp
index 6e28cdba6..1abb0e725 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 <dbghelp.h>
+#pragma warning(default:4091)
char *CrashLogWindows::AppendDecodedStacktrace(char *buffer, const char *last) const
{
diff --git a/src/stdafx.h b/src/stdafx.h
index d68605c19..4616212f1 100644
--- a/src/stdafx.h
+++ b/src/stdafx.h
@@ -223,7 +223,9 @@
#include <malloc.h> // 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 c41f3d9b4..385ca72b2 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 fd422ec63..6306e6f75 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