call DebugBreak on fatal error in _WINDOWS

This commit is contained in:
Chris Danford
2004-01-25 01:55:32 +00:00
parent 0b9f83060a
commit 08d91fe905
+6 -1
View File
@@ -87,7 +87,12 @@ namespace Checkpoints
#endif
/* The infinite loop isn't actually reached; it's just there to shut up a warning. */
static inline void NORETURN sm_crash() { *(char*)0=0; while(1) ; }
#ifdef _WINDOWS
#include "windows.h"
static inline void NORETURN sm_crash() { DebugBreak(); } // throws an exception that gets caught by the exception handler
#else
static inline void NORETURN sm_crash() { *(char*)0=0; while(1); }
#endif
/* Assertion that sets an optional message and brings up the crash handler, so
* we get a backtrace. This should probably be used instead of throwing an