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.
This commit is contained in:
Tobin Ehlis 2015-11-02 15:45:19 -07:00
parent b0ccaaf390
commit bd4964ff19

View File

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