Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define assert(cond) if(!(cond)) \
- { \
- debug_print("\nassert failed at: %s (%d)\n", __FILE__, __LINE__); \
- if(IsDebuggerPresent()) \
- { \
- __debugbreak(); \
- } \
- char assert_buffer[256] = {}; \
- sprintf_s(assert_buffer, sizeof(assert_buffer), "%s\n%s\n%s (%i)", #cond, __FUNCTION__, __FILE__, __LINE__); \
- int assert_box_result = MessageBox( \
- null, \
- assert_buffer, \
- "Assertion failed", \
- MB_RETRYCANCEL | MB_ICONERROR \
- ); \
- if(assert_box_result == 2) \
- { \
- exit(1); \
- } \
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement