- 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
+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
}