make assert-abort work in VC7

This commit is contained in:
David Rose 2002-03-11 19:16:44 +00:00
parent c3b7ae1eb5
commit ff04381a1d
1 changed files with 8 additions and 1 deletions

View File

@ -427,7 +427,14 @@ assert_failure(const char *expression, int line,
if (get_assert_abort()) {
#ifdef WIN32
assert(false);
// How to trigger an exception in VC++ that offers to take us into
// the debugger? abort() doesn't do it. We used to be able to
// assert(false), but in VC++ 7 that just throws an exception, and
// an uncaught exception just exits, without offering to open the
// debugger. Guess we'll have to force a segfault.
int *ptr = (int *)NULL;
*ptr = 1;
#else
abort();
#endif