aboutsummaryrefslogtreecommitdiff
path: root/loader
diff options
context:
space:
mode:
authorTobin Ehlis <tobin@lunarg.com>2015-11-02 15:45:19 -0700
committerTobin Ehlis <tobin@lunarg.com>2015-11-03 09:01:10 -0700
commitd4bd6087b4b83fb0f3666efac484fdb440bda973 (patch)
tree8f1872ae2facc891372a0790e7763c569af926ee /loader
parenta2514596a6f4ea865c1eb053bcee580b48f4b242 (diff)
downloadusermoji-d4bd6087b4b83fb0f3666efac484fdb440bda973.tar.xz
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.
Diffstat (limited to 'loader')
-rw-r--r--loader/vk_loader_platform.h8
1 files changed, 8 insertions, 0 deletions
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 <WinSock2.h>
#include <windows.h>
+// 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 <assert.h>
#include <stdio.h>
#include <io.h>