Correctly forward declare Win32 functions

_WINDOWS_ is the macro defined by the windows.h header guard,
checking it whether the symbols have already been included before
forward declaring our own.
This commit is contained in:
Arvid Gerstmann 2018-07-13 23:39:58 +02:00
parent 32fc011f80
commit ebd1d00178
2 changed files with 8 additions and 1 deletions

View File

@ -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

View File

@ -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* );