vkd3d: Introduce a softer form of assertion.

Triggering an ERR() instead of aborting the program.
This commit is contained in:
Giovanni Mascellani
2024-05-14 10:32:33 +02:00
committed by Henri Verbeet
parent a484063cd2
commit d7fc2693c4
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
3 changed files with 13 additions and 7 deletions

View File

@ -46,6 +46,12 @@
#define STATIC_ASSERT(e) extern void __VKD3D_STATIC_ASSERT__(int [(e) ? 1 : -1])
#define VKD3D_ASSERT(cond) \
do { \
if (!(cond)) \
ERR("Failed assertion: %s\n", #cond); \
} while (0)
#define MEMBER_SIZE(t, m) sizeof(((t *)0)->m)
#define VKD3D_MAKE_TAG(ch0, ch1, ch2, ch3) \