Changeset - r22200:a9da99055183
[Not reviewed]
master
0 5 0
michi_cc - 9 years ago 2015-08-10 20:21:29
michi_cc@openttd.org
(svn r27380) -Fix: [Win32] Compilation with MSVC2015.
5 files changed with 8 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/music/dmusic.cpp
Show inline comments
 
@@ -13,24 +13,25 @@
 

	
 
#define INITGUID
 
#include "../stdafx.h"
 
#ifdef WIN32_LEAN_AND_MEAN
 
	#undef WIN32_LEAN_AND_MEAN // Don't exclude rarely-used stuff from Windows headers
 
#endif
 
#include "../debug.h"
 
#include "../os/windows/win32.h"
 
#include "../core/mem_func.hpp"
 
#include "dmusic.h"
 

	
 
#include <windows.h>
 
#undef FACILITY_DIRECTMUSIC // Needed for newer Windows SDK version.
 
#include <dmksctrl.h>
 
#include <dmusici.h>
 
#include <dmusicc.h>
 
#include <dmusicf.h>
 

	
 
#include "../safeguards.h"
 

	
 
static FMusicDriver_DMusic iFMusicDriver_DMusic;
 

	
 
/** the direct music object manages buffers and ports */
 
static IDirectMusic *music = NULL;
 

	
src/os/windows/crashlog_win.cpp
Show inline comments
 
@@ -313,25 +313,27 @@ static char *PrintModuleInfo(char *outpu
 
				buffer += seprintf(buffer, last, " ????????"); // OCR: WAS - , 0);
 
			} else {
 
				buffer += seprintf(buffer, last, " %.8X", *b);
 
			}
 
			b++;
 
		}
 
		buffer += seprintf(buffer, last, "\n");
 
	}
 
	return buffer + seprintf(buffer, last, "\n");
 
}
 

	
 
#if defined(_MSC_VER)
 
#pragma warning(disable:4091)
 
#include <dbghelp.h>
 
#pragma warning(default:4091)
 

	
 
char *CrashLogWindows::AppendDecodedStacktrace(char *buffer, const char *last) const
 
{
 
#define M(x) x "\0"
 
	static const char dbg_import[] =
 
		M("dbghelp.dll")
 
		M("SymInitialize")
 
		M("SymSetOptions")
 
		M("SymCleanup")
 
		M("StackWalk64")
 
		M("SymFunctionTableAccess64")
 
		M("SymGetModuleBase64")
src/stdafx.h
Show inline comments
 
@@ -214,25 +214,27 @@
 
	#pragma warning(disable: 6326)   // code analyzer: potential comparison of a constant with another constant
 
	#pragma warning(disable: 6031)   // code analyzer: Return value ignored: 'ReadFile'
 
	#pragma warning(disable: 6255)   // code analyzer: _alloca indicates failure by raising a stack overflow exception. Consider using _malloca instead
 
	#pragma warning(disable: 6246)   // code analyzer: Local declaration of 'statspec' hides declaration of the same name in outer scope. For additional information, see previous declaration at ...
 

	
 
	#if (_MSC_VER == 1500)           // Addresses item #13 on http://blogs.msdn.com/b/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx, for Visual Studio 2008
 
		#define _DO_NOT_DECLARE_INTERLOCKED_INTRINSICS_IN_MEMORY
 
		#include <intrin.h>
 
	#endif
 

	
 
	#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
 
	#endif
 

	
 
	#define GCC_PACK
 
	#define WARN_FORMAT(string, args)
 
	#define FINAL sealed
 

	
 
	#if defined(WINCE)
 
		int CDECL vsnprintf(char *str, size_t size, const char *format, va_list ap);
 
	#endif
src/strgen/strgen_base.cpp
Show inline comments
 
@@ -369,25 +369,25 @@ char *ParseWord(char **buf)
 
		}
 
	}
 
	*buf = s;
 
	return r;
 
}
 

	
 
/* Forward declaration */
 
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);
 
	}
 
}
 

	
 
void EmitPlural(Buffer *buffer, char *buf, int value)
 
{
 
	int argidx = _cur_argidx;
 
	int offset = -1;
 
	int expected = _plural_forms[_lang.plural_form].plural_count;
 
	const char **words = AllocaM(const char *, max(expected, MAX_PLURALS));
src/string.cpp
Show inline comments
 
@@ -340,25 +340,25 @@ bool IsValidChar(WChar key, CharSetFilte
 
	switch (afilter) {
 
		case CS_ALPHANUMERAL:  return IsPrintable(key);
 
		case CS_NUMERAL:       return (key >= '0' && key <= '9');
 
		case CS_NUMERAL_SPACE: return (key >= '0' && key <= '9') || key == ' ';
 
		case CS_ALPHA:         return IsPrintable(key) && !(key >= '0' && key <= '9');
 
		case CS_HEXADECIMAL:   return (key >= '0' && key <= '9') || (key >= 'a' && key <= 'f') || (key >= 'A' && key <= 'F');
 
	}
 

	
 
	return false;
 
}
 

	
 
#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
 
 * implementation returns size whereas a POSIX implementation returns
 
 * size or more (the number of bytes that would be written to str
 
 * had size been sufficiently large excluding the terminating null byte).
 
 */
 
int CDECL vsnprintf(char *str, size_t size, const char *format, va_list ap)
 
{
 
	if (size == 0) return 0;
 

	
 
	errno = 0;
0 comments (0 inline, 0 general)