MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / GetHostInfo

Function GetHostInfo

Source/ThirdParty/tracy/client/TracyProfiler.cpp:511–770  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

509#endif
510
511static const char* GetHostInfo()
512{
513 static char buf[1024];
514 auto ptr = buf;
515#if defined _WIN32
516# ifdef TRACY_UWP
517 auto GetVersion = &::GetVersionEx;
518# else
519 auto GetVersion = (t_RtlGetVersion)GetProcAddress( GetModuleHandleA( "ntdll.dll" ), "RtlGetVersion" );
520# endif
521 if( !GetVersion )
522 {
523# ifdef __MINGW32__
524 ptr += sprintf( ptr, "OS: Windows (MingW)\n" );
525# else
526 ptr += sprintf( ptr, "OS: Windows\n" );
527# endif
528 }
529 else
530 {
531 RTL_OSVERSIONINFOW ver = { sizeof( RTL_OSVERSIONINFOW ) };
532 GetVersion( &ver );
533
534# ifdef __MINGW32__
535 ptr += sprintf( ptr, "OS: Windows %i.%i.%i (MingW)\n", (int)ver.dwMajorVersion, (int)ver.dwMinorVersion, (int)ver.dwBuildNumber );
536# else
537 auto WineGetVersion = (t_WineGetVersion)GetProcAddress( GetModuleHandleA( "ntdll.dll" ), "wine_get_version" );
538 auto WineGetBuildId = (t_WineGetBuildId)GetProcAddress( GetModuleHandleA( "ntdll.dll" ), "wine_get_build_id" );
539 if( WineGetVersion && WineGetBuildId )
540 {
541 ptr += sprintf( ptr, "OS: Windows %lu.%lu.%lu (Wine %s [%s])\n", ver.dwMajorVersion, ver.dwMinorVersion, ver.dwBuildNumber, WineGetVersion(), WineGetBuildId() );
542 }
543 else
544 {
545 ptr += sprintf( ptr, "OS: Windows %lu.%lu.%lu\n", ver.dwMajorVersion, ver.dwMinorVersion, ver.dwBuildNumber );
546 }
547# endif
548 }
549#elif defined __linux__
550 struct utsname utsName;
551 uname( &utsName );
552# if defined __ANDROID__
553 ptr += sprintf( ptr, "OS: Linux %s (Android)\n", utsName.release );
554# else
555 ptr += sprintf( ptr, "OS: Linux %s\n", utsName.release );
556# endif
557#elif defined __APPLE__
558# if TARGET_OS_IPHONE == 1
559 ptr += sprintf( ptr, "OS: Darwin (iOS)\n" );
560# elif TARGET_OS_MAC == 1
561 ptr += sprintf( ptr, "OS: Darwin (OSX)\n" );
562# else
563 ptr += sprintf( ptr, "OS: Darwin (unknown)\n" );
564# endif
565#elif defined __DragonFly__
566 ptr += sprintf( ptr, "OS: BSD (DragonFly)\n" );
567#elif defined __FreeBSD__
568 ptr += sprintf( ptr, "OS: BSD (FreeBSD)\n" );

Callers 1

WorkerMethod · 0.85

Calls 13

InitWinSockFunction · 0.85
memcpyFunction · 0.85
CpuIdFunction · 0.85
memcmpFunction · 0.85
GetHexFunction · 0.85
DecodeArmImplementerFunction · 0.85
DecodeArmPartFunction · 0.85
tracy_mallocFunction · 0.85
DecodeIosDeviceFunction · 0.85
tracy_freeFunction · 0.85
sysinfoClass · 0.85
GetMethod · 0.45

Tested by

no test coverage detected