From 6a83f9141bfc04e66d66fa02fa0f5f74d18fe38a Mon Sep 17 00:00:00 2001 From: glx Date: Sun, 9 Dec 2007 21:20:21 +0000 Subject: (svn r11611) -Codechange: it is now possible to use a define to enable asserts and show them in crash.log for MSVC release builds --- src/stdafx.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/stdafx.h') diff --git a/src/stdafx.h b/src/stdafx.h index a9cd8feb5..f3a277d5e 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -207,6 +207,13 @@ #define strcasecmp stricmp #define strncasecmp strnicmp #endif + + void SetExceptionString(const char* s, ...); + + #if defined(NDEBUG) && defined(WITH_ASSERT) + #undef assert + #define assert(expression) if (!(expression)) { SetExceptionString("Assertion failed at %s:%d: %s", __FILE__, __LINE__, #expression); *(byte*)0 = 0; } + #endif #endif /* defined(_MSC_VER) */ #if defined(WINCE) -- cgit v1.2.3-54-g00ecf