Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow compilation on android #7386

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion wpinet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion wpinet/examples/dsclient/dsclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ int main() {
});

// wait for a keypress to terminate
std::getchar();
static_cast<void>(std::getchar());
}
2 changes: 1 addition & 1 deletion wpinet/examples/parallelconnect/parallelconnect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ int main() {
});

// wait for a keypress to terminate
std::getchar();
static_cast<void>(std::getchar());
}
2 changes: 1 addition & 1 deletion wpinet/examples/webserver/webserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,5 @@ int main() {
});

// wait for a keypress to terminate
std::getchar();
static_cast<void>(std::getchar());
}
5 changes: 5 additions & 0 deletions wpiutil/src/main/native/unix/StackTrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Loading