2004-07-12 18:38:48 +02:00
|
|
|
#ifndef WDBG_H__
|
|
|
|
#define WDBG_H__
|
|
|
|
|
|
|
|
#include "win.h"
|
2004-06-19 16:54:25 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2004-07-12 18:38:48 +02:00
|
|
|
// assert with stack trace (including variable / parameter types and values)
|
|
|
|
// shown in a dialog, which offers
|
|
|
|
// continue, break, suppress (ignore this assert), and exit
|
2004-06-19 16:54:25 +02:00
|
|
|
|
2004-07-12 18:38:48 +02:00
|
|
|
// recommended use: assert2(expr && "descriptive string")
|
2004-06-19 16:54:25 +02:00
|
|
|
#define assert2(expr)\
|
|
|
|
{\
|
2004-07-12 18:38:48 +02:00
|
|
|
static int suppress__;\
|
|
|
|
if(!suppress__ && !expr)\
|
|
|
|
switch(wdbg_show_assert_dlg(__FILE__, __LINE__, #expr))\
|
2004-06-19 16:54:25 +02:00
|
|
|
{\
|
|
|
|
case 1:\
|
2004-07-12 18:38:48 +02:00
|
|
|
suppress__ = 1;\
|
2004-06-19 16:54:25 +02:00
|
|
|
break;\
|
|
|
|
\
|
|
|
|
case 2:\
|
2004-07-12 18:38:48 +02:00
|
|
|
win_debug_break();\
|
2004-06-19 16:54:25 +02:00
|
|
|
break;\
|
|
|
|
}\
|
|
|
|
}
|
|
|
|
|
2004-07-12 18:38:48 +02:00
|
|
|
extern int wdbg_show_assert_dlg(char* file, int line, char* expr);
|
2004-06-19 16:54:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2004-07-12 18:38:48 +02:00
|
|
|
#endif // #ifndef WDBG_H__
|