xref: /TaskScheduler/Scheduler/Include/MTDebug.h (revision 47d53e4d)
1 #pragma once
2 
3 #include <stdio.h>
4 
5 
6 #if defined(_MSC_VER)
7 
8 inline void ThrowException()
9 {
10 	__debugbreak();
11 }
12 
13 #else
14 
15 #include<signal.h>
16 
17 inline void ThrowException()
18 {
19 	raise(SIGTRAP);
20 }
21 
22 #endif
23 
24 
25 
26 
27 #define REPORT_ASSERT( condition, description, file, line ) printf("%s. %s, line %d\n", description, file, line);ThrowException();
28 
29 #define ASSERT( condition, description ) { if ( !(condition) ) { REPORT_ASSERT( #condition, description, __FILE__, __LINE__ ) } }
30 #define VERIFY( condition, description, operation ) { if ( !(condition) ) { { REPORT_ASSERT( #condition, description, __FILE__, __LINE__ ) }; operation; } }
31