diff options
author | glx <glx@openttd.org> | 2007-12-09 21:20:21 +0000 |
---|---|---|
committer | glx <glx@openttd.org> | 2007-12-09 21:20:21 +0000 |
commit | 15085aa7f47c06cb794a62a85240fdf12ca06bbc (patch) | |
tree | 9ac65ac4e5c5a30d1b8d89d7aa2e84d745e5abe7 /src/stdafx.h | |
parent | 8bd26725d355b4b4aa0e31b4768497cad8e30b88 (diff) | |
download | openttd-15085aa7f47c06cb794a62a85240fdf12ca06bbc.tar.xz |
(svn r11611) -Codechange: it is now possible to use a define to enable asserts and show them in crash.log for MSVC release builds
Diffstat (limited to 'src/stdafx.h')
-rw-r--r-- | src/stdafx.h | 7 |
1 files changed, 7 insertions, 0 deletions
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) |