vkd3d: Allow aborting on ERR().

This commit is contained in:
Giovanni Mascellani 2024-06-18 12:37:47 +02:00 committed by Henri Verbeet
parent d7fc2693c4
commit 4ada72a397
Notes: Henri Verbeet 2024-07-29 13:23:46 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Conor McCarthy (@cmccarthy)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/867

View File

@ -161,7 +161,7 @@ const char *debugstr_w(const WCHAR *wstr, size_t wchar_size);
#define VKD3D_DBG_LOG(level) \
do { \
const enum vkd3d_dbg_level vkd3d_dbg_level = VKD3D_DBG_LEVEL_##level; \
VKD3D_DBG_PRINTF
VKD3D_DBG_PRINTF_##level
#define VKD3D_DBG_LOG_ONCE(first_time_level, level) \
do { \
@ -169,11 +169,25 @@ const char *debugstr_w(const WCHAR *wstr, size_t wchar_size);
const enum vkd3d_dbg_level vkd3d_dbg_level = vkd3d_dbg_next_time \
? VKD3D_DBG_LEVEL_##level : VKD3D_DBG_LEVEL_##first_time_level; \
vkd3d_dbg_next_time = true; \
VKD3D_DBG_PRINTF
VKD3D_DBG_PRINTF_##level
#define VKD3D_DBG_PRINTF(...) \
vkd3d_dbg_printf(vkd3d_dbg_level, __FUNCTION__, __VA_ARGS__); } while (0)
#define VKD3D_DBG_PRINTF_TRACE(...) VKD3D_DBG_PRINTF(__VA_ARGS__)
#define VKD3D_DBG_PRINTF_WARN(...) VKD3D_DBG_PRINTF(__VA_ARGS__)
#define VKD3D_DBG_PRINTF_FIXME(...) VKD3D_DBG_PRINTF(__VA_ARGS__)
#define VKD3D_DBG_PRINTF_MESSAGE(...) VKD3D_DBG_PRINTF(__VA_ARGS__)
#ifdef VKD3D_ABORT_ON_ERR
#define VKD3D_DBG_PRINTF_ERR(...) \
vkd3d_dbg_printf(vkd3d_dbg_level, __FUNCTION__, __VA_ARGS__); \
abort(); \
} while (0)
#else
#define VKD3D_DBG_PRINTF_ERR(...) VKD3D_DBG_PRINTF(__VA_ARGS__)
#endif
#ifndef TRACE
#define TRACE VKD3D_DBG_LOG(TRACE)
#endif