mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01:42 +00:00
Allow compilation on android (#7386)
This commit is contained in:
@@ -202,7 +202,7 @@ foreach(example ${wpinet_examples})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
if(UNIX AND NOT APPLE AND NOT ANDROID)
|
||||
set(LIBUTIL -lutil)
|
||||
else()
|
||||
set(LIBUTIL)
|
||||
|
||||
@@ -32,5 +32,5 @@ int main() {
|
||||
});
|
||||
|
||||
// wait for a keypress to terminate
|
||||
std::getchar();
|
||||
static_cast<void>(std::getchar());
|
||||
}
|
||||
|
||||
@@ -48,5 +48,5 @@ int main() {
|
||||
});
|
||||
|
||||
// wait for a keypress to terminate
|
||||
std::getchar();
|
||||
static_cast<void>(std::getchar());
|
||||
}
|
||||
|
||||
@@ -85,5 +85,5 @@ int main() {
|
||||
});
|
||||
|
||||
// wait for a keypress to terminate
|
||||
std::getchar();
|
||||
static_cast<void>(std::getchar());
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user