libs/vkd3d-utils: Prefix defines with VKD3D_.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2018-04-24 17:32:55 +02:00 committed by Alexandre Julliard
parent 6988513d7b
commit 0ae0e431b1
4 changed files with 15 additions and 10 deletions

View File

@ -142,5 +142,6 @@ static inline HRESULT demo_create_root_signature(ID3D12Device *device,
#include "demo_win32.h" #include "demo_win32.h"
#else #else
#include <vkd3d_utils.h> #include <vkd3d_utils.h>
#define INFINITE VKD3D_INFINITE
#include "demo_xcb.h" #include "demo_xcb.h"
#endif #endif

View File

@ -23,10 +23,10 @@
extern "C" { extern "C" {
#endif /* __cplusplus */ #endif /* __cplusplus */
#define WAIT_OBJECT_0 (0) #define VKD3D_WAIT_OBJECT_0 (0)
#define WAIT_TIMEOUT (1) #define VKD3D_WAIT_TIMEOUT (1)
#define WAIT_FAILED (~0u) #define VKD3D_WAIT_FAILED (~0u)
#define INFINITE (~0u) #define VKD3D_INFINITE (~0u)
HANDLE vkd3d_create_event(void); HANDLE vkd3d_create_event(void);
HRESULT vkd3d_signal_event(HANDLE event); HRESULT vkd3d_signal_event(HANDLE event);

View File

@ -126,7 +126,7 @@ unsigned int vkd3d_wait_event(HANDLE event, unsigned int milliseconds)
if ((rc = pthread_mutex_lock(&impl->mutex))) if ((rc = pthread_mutex_lock(&impl->mutex)))
{ {
ERR("Failed to lock mutex, error %d.\n", rc); ERR("Failed to lock mutex, error %d.\n", rc);
return WAIT_FAILED; return VKD3D_WAIT_FAILED;
} }
if (impl->is_signaled || !milliseconds) 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; bool is_signaled = impl->is_signaled;
impl->is_signaled = false; impl->is_signaled = false;
pthread_mutex_unlock(&impl->mutex); 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 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); ERR("Failed to wait on condition variable, error %d.\n", rc);
pthread_mutex_unlock(&impl->mutex); pthread_mutex_unlock(&impl->mutex);
return WAIT_FAILED; return VKD3D_WAIT_FAILED;
} }
} while (!impl->is_signaled); } while (!impl->is_signaled);
impl->is_signaled = false; impl->is_signaled = false;
pthread_mutex_unlock(&impl->mutex); pthread_mutex_unlock(&impl->mutex);
return WAIT_OBJECT_0; return VKD3D_WAIT_OBJECT_0;
} }
pthread_mutex_unlock(&impl->mutex); pthread_mutex_unlock(&impl->mutex);
FIXME("Timed wait not implemented yet.\n"); FIXME("Timed wait not implemented yet.\n");
return WAIT_FAILED; return VKD3D_WAIT_FAILED;
} }
HRESULT vkd3d_signal_event(HANDLE event) HRESULT vkd3d_signal_event(HANDLE event)

View File

@ -201,6 +201,10 @@ static void destroy_event(HANDLE event)
CloseHandle(event); CloseHandle(event);
} }
#else #else
#define INFINITE VKD3D_INFINITE
#define WAIT_OBJECT_0 VKD3D_WAIT_OBJECT_0
#define WAIT_TIMEOUT VKD3D_WAIT_TIMEOUT
static HANDLE create_event(void) static HANDLE create_event(void)
{ {
return vkd3d_create_event(); return vkd3d_create_event();