Merged in Leandros99/tracy/dev (pull request #9)

Couple of minor compatibility fixes
This commit is contained in:
Arvid Gerstmann 2018-07-13 22:05:13 +00:00 committed by Bartosz Taudul
commit 9ac47eef0a
5 changed files with 20 additions and 2 deletions

View File

@ -3553,6 +3553,7 @@ private:
template<typename U>
static inline void destroy_array(U* p, size_t count)
{
((void)count);
if (p != nullptr) {
assert(count > 0);
(Traits::free)(p);

View File

@ -8,7 +8,9 @@
#endif
#ifdef _WIN32
#ifndef _WINDOWS_
extern "C" __declspec(dllimport) unsigned long __stdcall GetCurrentThreadId(void);
#endif
#else
# include <pthread.h>
#endif

View File

@ -35,10 +35,15 @@ namespace tracy
//---------------------------------------------------------
// Semaphore (Windows)
//---------------------------------------------------------
#ifndef MAXLONG
enum { MAXLONG = 0x7fffffff };
#endif
#ifndef INFINITE
enum { INFINITE = 0xFFFFFFFF };
#endif
#ifndef _WINDOWS_
typedef void* HANDLE;
extern "C" __declspec(dllimport) HANDLE __stdcall CreateSemaphoreA( void*, long, long, const char* );

View File

@ -22,6 +22,10 @@
# include "../nfd/nfd.h"
#endif
#ifndef M_PI_2
#define M_PI_2 1.57079632679489661923
#endif
namespace tracy
{

View File

@ -51,7 +51,13 @@ int main( int argc, char** argv )
float dpiScale = 1.f;
#ifdef _WIN32
dpiScale = GetDpiForSystem() / 96.f;
typedef UINT(*GDFS)(void);
GDFS getDpiForSystem = nullptr;
HMODULE dll = GetModuleHandleW(L"user32.dll");
if (dll != INVALID_HANDLE_VALUE)
getDpiForSystem = (GDFS)GetProcAddress(dll, "GetDpiForSystem");
if (getDpiForSystem)
dpiScale = getDpiForSystem() / 96.f;
#endif
// Setup ImGui binding