mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user