Originally Posted by
George2
I am wondering how assert is implemented internally? Using some soft interrupt or through by exception handling approach?
something like
Code:
#undef assert
#ifdef NDEBUG
#define assert(exp) ((void)0)
#else
#ifdef __cplusplus
extern "C" {
#endif
_CRTIMP void __cdecl _assert(void *, void *, unsigned);
#ifdef __cplusplus
}
#endif
#define assert(exp) (void)( (exp) || (_assert(#exp, __FILE__, __LINE__), 0) )
#endif /* NDEBUG */
<removed copyrighted code, sorry - CornedBee>
So it is just an __crtMessageBoxA call followed by _DbgBreak to start debugging