Improve Apple platform details

- Include OS version
- Add CPU details
- Correct username
This commit is contained in:
Jonathan Hargreaves
2026-10-01 22:51:43 +01:00
parent f55c69603f
commit 275b578c1b
2 changed files with 26 additions and 2 deletions

View File

@@ -362,6 +362,16 @@ TRACY_API const char* GetUserLogin()
const auto user = getlogin();
if( user ) return user;
return "(?)";
#elif defined __APPLE__
static char buf[4 * 1024];
struct passwd pwd;
struct passwd* res;
if( getpwuid_r( getuid(), &pwd, buf, sizeof( buf ), &res ) == 0 && res == &pwd && pwd.pw_name )
{
return pwd.pw_name;
}
getlogin_r( buf, sizeof( buf ) );
return buf;
#else
static char user[1024] = {};
getlogin_r( user, sizeof( user ) );