Signed-off-by: Alexandre Julliard julliard@winehq.org --- libs/vkd3d-utils/vkd3d_utils_main.c | 37 ++++++++++++++++++++++++++ libs/vkd3d-utils/vkd3d_utils_private.h | 8 ------ 2 files changed, 37 insertions(+), 8 deletions(-)
diff --git a/libs/vkd3d-utils/vkd3d_utils_main.c b/libs/vkd3d-utils/vkd3d_utils_main.c index 9c968cc65334..7fb042cc3cbc 100644 --- a/libs/vkd3d-utils/vkd3d_utils_main.c +++ b/libs/vkd3d-utils/vkd3d_utils_main.c @@ -327,6 +327,41 @@ HRESULT WINAPI D3DPreprocess(const void *data, SIZE_T size, const char *filename }
/* Events */ + +#ifdef _WIN32 + +HANDLE vkd3d_create_event(void) +{ + return CreateEventA(NULL, FALSE, FALSE, NULL); +} + +HRESULT vkd3d_signal_event(HANDLE event) +{ + SetEvent(event); + return S_OK; +} + +unsigned int vkd3d_wait_event(HANDLE event, unsigned int milliseconds) +{ + return WaitForSingleObject(event, milliseconds); +} + +void vkd3d_destroy_event(HANDLE event) +{ + CloseHandle(event); +} + +#else /* _WIN32 */ + +#include <pthread.h> + +struct vkd3d_event +{ + pthread_mutex_t mutex; + pthread_cond_t cond; + BOOL is_signaled; +}; + HANDLE vkd3d_create_event(void) { struct vkd3d_event *event; @@ -434,6 +469,8 @@ void vkd3d_destroy_event(HANDLE event) vkd3d_free(impl); }
+#endif /* _WIN32 */ + HRESULT WINAPI D3DCreateBlob(SIZE_T data_size, ID3D10Blob **blob) { HRESULT hr; diff --git a/libs/vkd3d-utils/vkd3d_utils_private.h b/libs/vkd3d-utils/vkd3d_utils_private.h index 06ac7e6bbfa2..1b8254b67b1a 100644 --- a/libs/vkd3d-utils/vkd3d_utils_private.h +++ b/libs/vkd3d-utils/vkd3d_utils_private.h @@ -23,7 +23,6 @@ #define NONAMELESSUNION #define VK_NO_PROTOTYPES
-#include <pthread.h> #include <vkd3d.h> #include <vkd3d_shader.h> #include <vkd3d_d3dcompiler.h> @@ -32,11 +31,4 @@ #include "vkd3d_memory.h" #include <vkd3d_utils.h>
-struct vkd3d_event -{ - pthread_mutex_t mutex; - pthread_cond_t cond; - BOOL is_signaled; -}; - #endif /* __VKD3D_UTILS_PRIVATE_H */