From 0ae0e431b15b13b6cca3023fdd63987198a308f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Tue, 24 Apr 2018 17:32:55 +0200 Subject: [PATCH] libs/vkd3d-utils: Prefix defines with VKD3D_. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Józef Kucia Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- demos/demo.h | 1 + include/vkd3d_utils.h | 8 ++++---- libs/vkd3d-utils/vkd3d_utils_main.c | 12 ++++++------ tests/d3d12.c | 4 ++++ 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/demos/demo.h b/demos/demo.h index 4645bd7f..2869ea7b 100644 --- a/demos/demo.h +++ b/demos/demo.h @@ -142,5 +142,6 @@ static inline HRESULT demo_create_root_signature(ID3D12Device *device, #include "demo_win32.h" #else #include +#define INFINITE VKD3D_INFINITE #include "demo_xcb.h" #endif diff --git a/include/vkd3d_utils.h b/include/vkd3d_utils.h index 49987d03..6c926e4e 100644 --- a/include/vkd3d_utils.h +++ b/include/vkd3d_utils.h @@ -23,10 +23,10 @@ extern "C" { #endif /* __cplusplus */ -#define WAIT_OBJECT_0 (0) -#define WAIT_TIMEOUT (1) -#define WAIT_FAILED (~0u) -#define INFINITE (~0u) +#define VKD3D_WAIT_OBJECT_0 (0) +#define VKD3D_WAIT_TIMEOUT (1) +#define VKD3D_WAIT_FAILED (~0u) +#define VKD3D_INFINITE (~0u) HANDLE vkd3d_create_event(void); HRESULT vkd3d_signal_event(HANDLE event); diff --git a/libs/vkd3d-utils/vkd3d_utils_main.c b/libs/vkd3d-utils/vkd3d_utils_main.c index 3c0d1397..2c4d89a7 100644 --- a/libs/vkd3d-utils/vkd3d_utils_main.c +++ b/libs/vkd3d-utils/vkd3d_utils_main.c @@ -126,7 +126,7 @@ unsigned int vkd3d_wait_event(HANDLE event, unsigned int milliseconds) if ((rc = pthread_mutex_lock(&impl->mutex))) { ERR("Failed to lock mutex, error %d.\n", rc); - return WAIT_FAILED; + return VKD3D_WAIT_FAILED; } if (impl->is_signaled || !milliseconds) @@ -134,10 +134,10 @@ unsigned int vkd3d_wait_event(HANDLE event, unsigned int milliseconds) bool is_signaled = impl->is_signaled; impl->is_signaled = false; pthread_mutex_unlock(&impl->mutex); - return is_signaled ? WAIT_OBJECT_0 : WAIT_TIMEOUT; + return is_signaled ? VKD3D_WAIT_OBJECT_0 : VKD3D_WAIT_TIMEOUT; } - if (milliseconds == INFINITE) + if (milliseconds == VKD3D_INFINITE) { do { @@ -145,18 +145,18 @@ unsigned int vkd3d_wait_event(HANDLE event, unsigned int milliseconds) { ERR("Failed to wait on condition variable, error %d.\n", rc); pthread_mutex_unlock(&impl->mutex); - return WAIT_FAILED; + return VKD3D_WAIT_FAILED; } } while (!impl->is_signaled); impl->is_signaled = false; pthread_mutex_unlock(&impl->mutex); - return WAIT_OBJECT_0; + return VKD3D_WAIT_OBJECT_0; } pthread_mutex_unlock(&impl->mutex); FIXME("Timed wait not implemented yet.\n"); - return WAIT_FAILED; + return VKD3D_WAIT_FAILED; } HRESULT vkd3d_signal_event(HANDLE event) diff --git a/tests/d3d12.c b/tests/d3d12.c index ea7d24da..c7303f8d 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -201,6 +201,10 @@ static void destroy_event(HANDLE event) CloseHandle(event); } #else +#define INFINITE VKD3D_INFINITE +#define WAIT_OBJECT_0 VKD3D_WAIT_OBJECT_0 +#define WAIT_TIMEOUT VKD3D_WAIT_TIMEOUT + static HANDLE create_event(void) { return vkd3d_create_event();