diff --git a/source/lib/sysdep/sysdep.h b/source/lib/sysdep/sysdep.h index 7748601d91..0233abdabd 100755 --- a/source/lib/sysdep/sysdep.h +++ b/source/lib/sysdep/sysdep.h @@ -17,10 +17,16 @@ extern "C" { extern void display_msg(const char* caption, const char* msg); extern void wdisplay_msg(const wchar_t* caption, const wchar_t* msg); -extern void debug_out(const char* fmt, ...); +extern void debug_out(const char* fmt, ...); extern void debug_break(); + +// assert with stack trace (including variable / parameter types and values) +// shown in a dialog, which offers +// continue, break, suppress (ignore this assert), and exit +extern int debug_assert_failed(const char* file, int line, const char* expr); + extern void check_heap(); diff --git a/source/lib/sysdep/win/wdbg.cpp b/source/lib/sysdep/win/wdbg.cpp index 6b08bef155..6ad8edcabb 100755 --- a/source/lib/sysdep/win/wdbg.cpp +++ b/source/lib/sysdep/win/wdbg.cpp @@ -612,7 +612,7 @@ static void set_exception_handler() -int wdbg_show_assert_dlg(char* file, int line, char* expr) +int debug_assert_failed(const char* file, int line, const char* expr) { ONCE(dbg_init()); diff --git a/source/lib/sysdep/win/wdbg.h b/source/lib/sysdep/win/wdbg.h index b07744fa20..4de9b28a89 100755 --- a/source/lib/sysdep/win/wdbg.h +++ b/source/lib/sysdep/win/wdbg.h @@ -8,28 +8,8 @@ extern "C" { #endif -// assert with stack trace (including variable / parameter types and values) -// shown in a dialog, which offers -// continue, break, suppress (ignore this assert), and exit -// recommended use: assert2(expr && "descriptive string") -#define assert2(expr)\ -{\ - static int suppress__;\ - if(!suppress__ && !expr)\ - switch(wdbg_show_assert_dlg(__FILE__, __LINE__, #expr))\ - {\ - case 1:\ - suppress__ = 1;\ - break;\ -\ - case 2:\ - win_debug_break();\ - break;\ - }\ -} -extern int wdbg_show_assert_dlg(char* file, int line, char* expr); #ifdef __cplusplus