mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-23 06:44:35 +00:00
Merged in Leandros99/tracy/dev (pull request #9)
Couple of minor compatibility fixes
This commit is contained in:
commit
9ac47eef0a
@ -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);
|
||||
|
@ -8,7 +8,9 @@
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifndef _WINDOWS_
|
||||
extern "C" __declspec(dllimport) unsigned long __stdcall GetCurrentThreadId(void);
|
||||
#endif
|
||||
#else
|
||||
# include <pthread.h>
|
||||
#endif
|
||||
|
@ -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* );
|
||||
|
@ -22,6 +22,10 @@
|
||||
# include "../nfd/nfd.h"
|
||||
#endif
|
||||
|
||||
#ifndef M_PI_2
|
||||
#define M_PI_2 1.57079632679489661923
|
||||
#endif
|
||||
|
||||
namespace tracy
|
||||
{
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user