X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Finclude%2Flogdebug.h;h=c5337439162644450f4df0f25fe7c6257bef046d;hb=0e844bc15a212d0e933b6243a9a9964ab7925c4f;hp=c2faf7d23fb97040ea1ad91097efd5678c451130;hpb=015f48988e0ff398409d71dfc692005ab439490a;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/include/logdebug.h b/KernelLand/Kernel/include/logdebug.h index c2faf7d2..c5337439 100644 --- a/KernelLand/Kernel/include/logdebug.h +++ b/KernelLand/Kernel/include/logdebug.h @@ -58,10 +58,16 @@ extern void Debug_HexDump(const char *Header, const void *Data, size_t Length); # define LEAVE_RET0() return #endif #if !DISABLE_ASSERTS -# define ASSERT(expr) do{if(!(expr))Panic("%s:%i - %s: Assertion '"#expr"' failed",__FILE__,__LINE__,(char*)__func__);}while(0) +# define ASSERTV(expr,msg,args...) do{if(!(expr))Panic("%s:%i - %s: Assertion '"#expr"' failed"msg,__FILE__,__LINE__,(char*)__func__,##args);}while(0) +# define ASSERTRV(expr,rv,msg,args...) do{if(!(expr)){Warning("%s:%i: Assertion '"#expr"' failed"msg,__FILE__,__LINE__,(char*)__func__ , ##args);return rv;}}while(0) #else -# define ASSERT(expr) +# define ASSERTV(expr) +# define ASSERTRV(expr) #endif +#define ASSERT(expr) ASSERTV(expr, "") +#define ASSERTR(expr,rv) ASSERTRV(expr, rv, "") +#define ASSERTC(l,rel,r) ASSERTV(l rel r, ": %i"#rel"%i", l, r) +#define ASSERTCR(l,rel,r,rv) ASSERTRV(l rel r, rv, ": %i"#rel"%i", l, r) /** * \} */