mirror of
https://github.com/wolfpld/tracy
synced 2025-05-08 16:03:53 +00:00
Remove windows.h dependency from tracy_sema.h.
This commit is contained in:
parent
16a98c8c17
commit
66ad415ce5
@ -30,9 +30,16 @@ namespace tracy
|
|||||||
// Semaphore (Windows)
|
// Semaphore (Windows)
|
||||||
//---------------------------------------------------------
|
//---------------------------------------------------------
|
||||||
|
|
||||||
#include <windows.h>
|
#ifndef MAXLONG
|
||||||
#undef min
|
enum { MAXLONG = 0x7fffffff };
|
||||||
#undef max
|
enum { INFINITE = 0xFFFFFFFF };
|
||||||
|
typedef void* HANDLE;
|
||||||
|
|
||||||
|
extern "C" __declspec(dllimport) HANDLE __stdcall CreateSemaphoreA( void*, long, long, const char* );
|
||||||
|
extern "C" __declspec(dllimport) int __stdcall CloseHandle( HANDLE );
|
||||||
|
extern "C" __declspec(dllimport) unsigned long __stdcall WaitForSingleObject( HANDLE, unsigned long );
|
||||||
|
extern "C" __declspec(dllimport) int __stdcall ReleaseSemaphore( HANDLE, long, long* );
|
||||||
|
#endif
|
||||||
|
|
||||||
class Semaphore
|
class Semaphore
|
||||||
{
|
{
|
||||||
@ -46,7 +53,7 @@ public:
|
|||||||
Semaphore(int initialCount = 0)
|
Semaphore(int initialCount = 0)
|
||||||
{
|
{
|
||||||
assert(initialCount >= 0);
|
assert(initialCount >= 0);
|
||||||
m_hSema = CreateSemaphore(NULL, initialCount, MAXLONG, NULL);
|
m_hSema = CreateSemaphoreA(NULL, initialCount, MAXLONG, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
~Semaphore()
|
~Semaphore()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user