Output script call stack on ASSERT.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5043 4a71c877-e1ca-e34f-864e-861f7616d084
master
Roman C 2008-05-11 11:51:23 +00:00
parent 85848067f4
commit da83c65c9c
1 changed files with 2 additions and 0 deletions

View File

@ -32,6 +32,7 @@
#endif
#include <assert.h>
#include "lib/script/interp.h"
#if defined(__cplusplus)
extern "C"
@ -57,6 +58,7 @@ extern char last_called_script_event[MAX_EVENT_NAME_LEN];
* Arguments: ASSERT( condition, "Format string with variables: %d, %d", var1, var2 );
*/
#define ASSERT( expr, ... ) \
( (expr) ? (void)0 : scrOutputCallTrace() ); \
( (expr) ? (void)0 : (void)_debug( LOG_ERROR, __FUNCTION__, __VA_ARGS__ ) ); \
( (expr) ? (void)0 : (void)_debug( LOG_ERROR, __FUNCTION__, "Assert in Warzone: %s:%d (%s), last script event: '%s'", \
__FILE__, __LINE__, (#expr), last_called_script_event ) ); \