Allow compilation on android (#7386)

This commit is contained in:
Thad House
2024-11-12 16:39:41 -08:00
committed by GitHub
parent 07345712dc
commit c289562a06
5 changed files with 9 additions and 4 deletions

View File

@@ -16,6 +16,7 @@
namespace wpi {
std::string GetStackTraceDefault(int offset) {
#ifndef __ANDROID__
void* stackTrace[128];
int stackSize = backtrace(stackTrace, 128);
char** mangledSymbols = backtrace_symbols(stackTrace, stackSize);
@@ -38,6 +39,10 @@ std::string GetStackTraceDefault(int offset) {
std::free(mangledSymbols);
return std::string{trace.str()};
#else
// backtrace_symbols not supported on android
return "";
#endif
}
} // namespace wpi