- Fixed compilation error in VS 2005

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5162 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2012-04-04 21:09:03 +00:00
parent 0c282a818a
commit bfe22f24f8
3 changed files with 21 additions and 9 deletions
-5
View File
@@ -91,11 +91,6 @@
//#define FRENCH
//#define ITALIAN
//#define TAIWANESE
// WANNE: The pragma and the exclusive VS2008/VS2010 compilation should not be needed anymore for Polish version, after we set the encoding to UTF8
// WANNE: If we like to build Polish version, we have to do this in VS2008/VS2010, because in VS2005 we get weird behavior (progress bar not moving when loading sector, ...).
// To get correct display of Polish letters, it is needed to set "#pragma setlocale("POLISH")" in "_PolishText.cpp" and "_"Ja25PolishText.cpp.
// Unfortunatelly setting the "pragma" causes the weird behavior when building in VS2005, this is why we should build in VS2008/VS2010.
//#define POLISH
// WANNE: For CHINESE language we also have to define WINFONTS! So when building Chinese version, enable both defines.
@@ -1022,8 +1022,16 @@ static BOOL ERGenerateMiniDump(CHAR *szFileName, PEXCEPTION_POINTERS pExceptionI
// We need the SeDebugPrivilege to be able to run MiniDumpWriteDump
bPrivilegeEnabled = EREnablePriv(SE_DEBUG_NAME, hImpersonationToken, &tp);
// VS 2008 and VS 2010
#if _MSC_VER >= 1500
bRet = ERMiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), hDumpFile
, (MINIDUMP_TYPE)(MiniDumpWithHandleData|MiniDumpWithThreadInfo|MiniDumpWithDataSegs), &stInfo, NULL, NULL);
// VS 2005
#else
bRet = ERMiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), hDumpFile
, (MINIDUMP_TYPE)(MiniDumpWithHandleData|MiniDumpWithDataSegs), &stInfo, NULL, NULL);
#endif
if(bPrivilegeEnabled)
{
// Restore the privilege
+13 -4
View File
@@ -163,6 +163,7 @@ namespace {
} // namespace
#define ENABLE_STACK_TRACE 0
StackTrace::StackTrace() {
// From http://msdn.microsoft.com/en-us/library/bb204633(VS.85).aspx,
// the sum of FramesToSkip and FramesToCapture must be less than 63,
@@ -170,20 +171,28 @@ StackTrace::StackTrace() {
const int kMaxCallers = 62;
// TODO(ajwong): Migrate this to StackWalk64.
// WANNE: VS 2005 compilation error
// WANNE: I disabled the method call "CaptureStackBackTrace()" because it gives a compilation error in VS 2005
#if ENABLE_STACK_TRACE
// WANNE: This only works with Visual Studio version >= 2008
#if _MSC_VER >= 1500
void* callers[kMaxCallers];
int count = CaptureStackBackTrace(0, kMaxCallers, callers, NULL);
// WANNE: This also does not work in VS 2005
// Not used, because we use CaptureStackBackTrace()
//int count = RtlCaptureStackBackTrace(0, kMaxCallers, callers, NULL);
if (count > 0) {
trace_.resize(count);
memcpy(&trace_[0], callers, sizeof(callers[0]) * count);
} else {
}
else
{
trace_.resize(0);
}
#endif
#endif
}