mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-27 00:04: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>
|
template<typename U>
|
||||||
static inline void destroy_array(U* p, size_t count)
|
static inline void destroy_array(U* p, size_t count)
|
||||||
{
|
{
|
||||||
|
((void)count);
|
||||||
if (p != nullptr) {
|
if (p != nullptr) {
|
||||||
assert(count > 0);
|
assert(count > 0);
|
||||||
(Traits::free)(p);
|
(Traits::free)(p);
|
||||||
|
@ -8,7 +8,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
#ifndef _WINDOWS_
|
||||||
extern "C" __declspec(dllimport) unsigned long __stdcall GetCurrentThreadId(void);
|
extern "C" __declspec(dllimport) unsigned long __stdcall GetCurrentThreadId(void);
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
# include <pthread.h>
|
# include <pthread.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -35,10 +35,15 @@ namespace tracy
|
|||||||
//---------------------------------------------------------
|
//---------------------------------------------------------
|
||||||
// Semaphore (Windows)
|
// Semaphore (Windows)
|
||||||
//---------------------------------------------------------
|
//---------------------------------------------------------
|
||||||
|
|
||||||
#ifndef MAXLONG
|
#ifndef MAXLONG
|
||||||
enum { MAXLONG = 0x7fffffff };
|
enum { MAXLONG = 0x7fffffff };
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef INFINITE
|
||||||
enum { INFINITE = 0xFFFFFFFF };
|
enum { INFINITE = 0xFFFFFFFF };
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _WINDOWS_
|
||||||
typedef void* HANDLE;
|
typedef void* HANDLE;
|
||||||
|
|
||||||
extern "C" __declspec(dllimport) HANDLE __stdcall CreateSemaphoreA( void*, long, long, const char* );
|
extern "C" __declspec(dllimport) HANDLE __stdcall CreateSemaphoreA( void*, long, long, const char* );
|
||||||
|
@ -22,6 +22,10 @@
|
|||||||
# include "../nfd/nfd.h"
|
# include "../nfd/nfd.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef M_PI_2
|
||||||
|
#define M_PI_2 1.57079632679489661923
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace tracy
|
namespace tracy
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -51,7 +51,13 @@ int main( int argc, char** argv )
|
|||||||
|
|
||||||
float dpiScale = 1.f;
|
float dpiScale = 1.f;
|
||||||
#ifdef _WIN32
|
#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
|
#endif
|
||||||
|
|
||||||
// Setup ImGui binding
|
// Setup ImGui binding
|
||||||
|
Loading…
Reference in New Issue
Block a user