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

Add basic Android support #217

Merged
merged 4 commits into from
May 13, 2024
Merged
Changes from 1 commit
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
Next Next commit
Fix compilation for old Android NDK/SDK
  • Loading branch information
jstefanelli committed Apr 17, 2024
commit 4c592e5b330e1df47c78f9ffb0a46b9103692d6f
11 changes: 11 additions & 0 deletions src/hostname.cc
Original file line number Diff line number Diff line change
@@ -48,6 +48,16 @@ std::string uvgrtp::hostname::get_username()
}

return std::string(buffer);
#else
#ifdef ANDROID
const char* username = getlogin();

if (username == nullptr) {
UVG_LOG_ERROR("%s", strerror(errno));
return "";
}

return std::string(username);
#else
char username[NAME_MAXLEN];

@@ -58,4 +68,5 @@ std::string uvgrtp::hostname::get_username()

return std::string(username);
#endif
#endif
}