From c5a229acfe27d92061502f655dbca5ff29d3f3b6 Mon Sep 17 00:00:00 2001 From: Aty_0 <54220849+Aty-0@users.noreply.github.com> Date: Thu, 21 Dec 2023 10:07:43 +0300 Subject: [PATCH] Implemented `ASSERTF` --- ref/vk/vk_common.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ref/vk/vk_common.h b/ref/vk/vk_common.h index eb1156bb4..5244ce6c2 100644 --- a/ref/vk/vk_common.h +++ b/ref/vk/vk_common.h @@ -8,7 +8,14 @@ #include "crtlib.h" #define ASSERT(x) if(!( x )) gEngine.Host_Error( "assert %s failed at %s:%d\n", #x, __FILE__, __LINE__ ) -// TODO ASSERTF(x, fmt, ...) + +#define ASSERTF(x, fmt, ...) \ + do { \ + if(!(x)) \ + { \ + gEngine.Host_Error("assert %s failed at %s:%d msg:" fmt "\n", #x, __FILE__, __LINE__, ##__VA_ARGS__); \ + } \ + } while(0) #define Mem_Malloc( pool, size ) gEngine._Mem_Alloc( pool, size, false, __FILE__, __LINE__ ) #define Mem_Calloc( pool, size ) gEngine._Mem_Alloc( pool, size, true, __FILE__, __LINE__ )