Skip to content

Commit 93add63

Browse files
committed
add assert macro
1 parent fa0959c commit 93add63

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

hdr/debug.h

+13-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@
4444
#endif
4545
#endif
4646

47+
48+
/* assert macro */
49+
#ifdef DEBUG
50+
VOID panic(BYTE * s);
51+
#define assert(condition) (void)(!(condition)?panic(#condition),0:0)
52+
#else
53+
#define assert(condition) /* ((void)0) */
54+
#endif
55+
56+
4757
/* use to limit output to debug builds */
4858
#ifdef DEBUG
4959
#ifdef DEBUG_PRINT_COMPORT
@@ -117,7 +127,9 @@
117127
#endif
118128

119129
/* debug truename */
120-
/* #define DEBUG_TRUENAME */
130+
#ifdef DEBUG
131+
#define DEBUG_TRUENAME
132+
#endif
121133
#ifdef DEBUG_TRUENAME
122134
#define tn_printf(x) DebugPrintf(x)
123135
#else

0 commit comments

Comments
 (0)