mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +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)
|
||||
//---------------------------------------------------------
|
||||
|
||||
#include <windows.h>
|
||||
#undef min
|
||||
#undef max
|
||||
#ifndef MAXLONG
|
||||
enum { MAXLONG = 0x7fffffff };
|
||||
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
|
||||
{
|
||||
@ -46,7 +53,7 @@ public:
|
||||
Semaphore(int initialCount = 0)
|
||||
{
|
||||
assert(initialCount >= 0);
|
||||
m_hSema = CreateSemaphore(NULL, initialCount, MAXLONG, NULL);
|
||||
m_hSema = CreateSemaphoreA(NULL, initialCount, MAXLONG, NULL);
|
||||
}
|
||||
|
||||
~Semaphore()
|
||||
|
Loading…
Reference in New Issue
Block a user