Skip to content

Commit 18fcb26

Browse files
committed
fix: resolve -Wunused-function warning
1 parent 7a65315 commit 18fcb26

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/stacktraces.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ static uint64_t GetBaseAddress()
146146
return 0;
147147
}
148148

149+
#ifdef ENABLE_STACKTRACES
149150
// PC addresses returned by StackWalk64 are in the real mapped space, while libbacktrace expects them to be in the
150151
// default mapped space starting at 0x400000. This method converts the address.
151152
// TODO this is probably the same reason libbacktrace is not able to gather the stacktrace on Windows (returns pointers like 0x1 or 0xfffffff)
@@ -161,6 +162,7 @@ static uint64_t ConvertAddress(uint64_t addr)
161162
uint64_t offset = addr - hMod;
162163
return 0x400000 + offset;
163164
}
165+
#endif // ENABLE_STACKTRACES
164166

165167
static __attribute__((noinline)) std::vector<uint64_t> GetStackFrames(size_t skip, size_t max_frames, const CONTEXT* pContext = nullptr)
166168
{

0 commit comments

Comments
 (0)