mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Detect and report if running under Wine.
This commit is contained in:
parent
64f2008cc1
commit
ea4de3be36
@ -106,6 +106,8 @@
|
||||
# include <lmcons.h>
|
||||
extern "C" typedef LONG (WINAPI *t_RtlGetVersion)( PRTL_OSVERSIONINFOW );
|
||||
extern "C" typedef BOOL (WINAPI *t_GetLogicalProcessorInformationEx)( LOGICAL_PROCESSOR_RELATIONSHIP, PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX, PDWORD );
|
||||
extern "C" typedef char* (WINAPI *t_WineGetVersion)();
|
||||
extern "C" typedef char* (WINAPI *t_WineGetBuildId)();
|
||||
#else
|
||||
# include <unistd.h>
|
||||
# include <limits.h>
|
||||
@ -521,7 +523,16 @@ static const char* GetHostInfo()
|
||||
# ifdef __MINGW32__
|
||||
ptr += sprintf( ptr, "OS: Windows %i.%i.%i (MingW)\n", (int)ver.dwMajorVersion, (int)ver.dwMinorVersion, (int)ver.dwBuildNumber );
|
||||
# else
|
||||
auto WineGetVersion = (t_WineGetVersion)GetProcAddress( GetModuleHandleA( "ntdll.dll" ), "wine_get_version" );
|
||||
auto WineGetBuildId = (t_WineGetBuildId)GetProcAddress( GetModuleHandleA( "ntdll.dll" ), "wine_get_build_id" );
|
||||
if( WineGetVersion && WineGetBuildId )
|
||||
{
|
||||
ptr += sprintf( ptr, "OS: Windows %lu.%lu.%lu (Wine %s [%s])\n", ver.dwMajorVersion, ver.dwMinorVersion, ver.dwBuildNumber, WineGetVersion(), WineGetBuildId() );
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr += sprintf( ptr, "OS: Windows %lu.%lu.%lu\n", ver.dwMajorVersion, ver.dwMinorVersion, ver.dwBuildNumber );
|
||||
}
|
||||
# endif
|
||||
}
|
||||
#elif defined __linux__
|
||||
|
Loading…
Reference in New Issue
Block a user