diff --git a/Language Defines.h b/Language Defines.h index e8640029..f66bac21 100644 --- a/Language Defines.h +++ b/Language Defines.h @@ -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. diff --git a/Standard Gaming Platform/ExceptionHandling.cpp b/Standard Gaming Platform/ExceptionHandling.cpp index 06986561..b63e48bb 100644 --- a/Standard Gaming Platform/ExceptionHandling.cpp +++ b/Standard Gaming Platform/ExceptionHandling.cpp @@ -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 diff --git a/Standard Gaming Platform/debug_win_util.cpp b/Standard Gaming Platform/debug_win_util.cpp index 7dd9ffeb..7e413a59 100644 --- a/Standard Gaming Platform/debug_win_util.cpp +++ b/Standard Gaming Platform/debug_win_util.cpp @@ -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 }