From 2ebe9b72d162431729c8b9a99119871d22594679 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 27 Aug 2018 13:59:19 +0200 Subject: [PATCH] There's no getlogin_t() on android. --- client/TracyProfiler.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index 502b45c8..871ce8d1 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -256,7 +256,19 @@ static const char* GetHostInfo() char user[LOGIN_NAME_MAX]; gethostname( hostname, HOST_NAME_MAX ); +# if defined __ANDROID__ + const auto login = getlogin(); + if( login ) + { + strcpy( user, login ); + } + else + { + memcpy( user, "(?)", 4 ); + } +# else getlogin_r( user, LOGIN_NAME_MAX ); +# endif ptr += sprintf( ptr, "User: %s@%s\n", user, hostname ); #endif