mirror of
https://github.com/1dot13/source.git
synced 2026-08-26 14:30:26 +02:00
- 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:
@@ -91,11 +91,6 @@
|
|||||||
//#define FRENCH
|
//#define FRENCH
|
||||||
//#define ITALIAN
|
//#define ITALIAN
|
||||||
//#define TAIWANESE
|
//#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
|
//#define POLISH
|
||||||
|
|
||||||
// WANNE: For CHINESE language we also have to define WINFONTS! So when building Chinese version, enable both defines.
|
// 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
|
// We need the SeDebugPrivilege to be able to run MiniDumpWriteDump
|
||||||
bPrivilegeEnabled = EREnablePriv(SE_DEBUG_NAME, hImpersonationToken, &tp);
|
bPrivilegeEnabled = EREnablePriv(SE_DEBUG_NAME, hImpersonationToken, &tp);
|
||||||
|
|
||||||
|
// VS 2008 and VS 2010
|
||||||
|
#if _MSC_VER >= 1500
|
||||||
bRet = ERMiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), hDumpFile
|
bRet = ERMiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), hDumpFile
|
||||||
, (MINIDUMP_TYPE)(MiniDumpWithHandleData|MiniDumpWithThreadInfo|MiniDumpWithDataSegs), &stInfo, NULL, NULL);
|
, (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)
|
if(bPrivilegeEnabled)
|
||||||
{
|
{
|
||||||
// Restore the privilege
|
// Restore the privilege
|
||||||
|
|||||||
@@ -163,6 +163,7 @@ namespace {
|
|||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
#define ENABLE_STACK_TRACE 0
|
#define ENABLE_STACK_TRACE 0
|
||||||
|
|
||||||
StackTrace::StackTrace() {
|
StackTrace::StackTrace() {
|
||||||
// From http://msdn.microsoft.com/en-us/library/bb204633(VS.85).aspx,
|
// From http://msdn.microsoft.com/en-us/library/bb204633(VS.85).aspx,
|
||||||
// the sum of FramesToSkip and FramesToCapture must be less than 63,
|
// the sum of FramesToSkip and FramesToCapture must be less than 63,
|
||||||
@@ -170,20 +171,28 @@ StackTrace::StackTrace() {
|
|||||||
const int kMaxCallers = 62;
|
const int kMaxCallers = 62;
|
||||||
// TODO(ajwong): Migrate this to StackWalk64.
|
// 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
|
#if ENABLE_STACK_TRACE
|
||||||
|
|
||||||
|
// WANNE: This only works with Visual Studio version >= 2008
|
||||||
|
#if _MSC_VER >= 1500
|
||||||
|
|
||||||
void* callers[kMaxCallers];
|
void* callers[kMaxCallers];
|
||||||
int count = CaptureStackBackTrace(0, kMaxCallers, callers, NULL);
|
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);
|
//int count = RtlCaptureStackBackTrace(0, kMaxCallers, callers, NULL);
|
||||||
|
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
trace_.resize(count);
|
trace_.resize(count);
|
||||||
memcpy(&trace_[0], callers, sizeof(callers[0]) * count);
|
memcpy(&trace_[0], callers, sizeof(callers[0]) * count);
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
trace_.resize(0);
|
trace_.resize(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user