From d4bd6087b4b83fb0f3666efac484fdb440bda973 Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Mon, 2 Nov 2015 15:45:19 -0700 Subject: layers: Windows define fixes On windows WinBase.h redefines CreateSemaphore and synchapi.h redefines CreateEvent. Depending on order or header includes, this can break the build due to VkLayerDispatchTable struct having CreateSemaphore and CreateEvent members. To fix this conflict, undef those symbols after including windows.h. --- loader/vk_loader_platform.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'loader/vk_loader_platform.h') diff --git a/loader/vk_loader_platform.h b/loader/vk_loader_platform.h index 5b94948b..4af76f62 100644 --- a/loader/vk_loader_platform.h +++ b/loader/vk_loader_platform.h @@ -198,6 +198,14 @@ static inline void loader_platform_thread_cond_broadcast(loader_platform_thread_ // Headers: #include #include +// WinBase.h defines CreateSemaphore and synchapi.h defines CreateEvent +// undefine them to avoid conflicts with VkLayerDispatchTable struct members. +#ifdef CreateSemaphore +#undef CreateSemaphore +#endif +#ifdef CreateEvent +#undef CreateEvent +#endif #include #include #include -- cgit v1.2.3