From ebd1d00178456da48864f9d3b2201788f3957d57 Mon Sep 17 00:00:00 2001 From: Arvid Gerstmann Date: Fri, 13 Jul 2018 23:39:58 +0200 Subject: [PATCH] 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. --- common/TracySystem.hpp | 2 ++ common/tracy_sema.h | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/common/TracySystem.hpp b/common/TracySystem.hpp index d5e98ecd..489f5a35 100644 --- a/common/TracySystem.hpp +++ b/common/TracySystem.hpp @@ -8,7 +8,9 @@ #endif #ifdef _WIN32 +#ifndef _WINDOWS_ extern "C" __declspec(dllimport) unsigned long __stdcall GetCurrentThreadId(void); +#endif #else # include #endif diff --git a/common/tracy_sema.h b/common/tracy_sema.h index 2419bb79..d0584987 100644 --- a/common/tracy_sema.h +++ b/common/tracy_sema.h @@ -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* );