aboutsummaryrefslogtreecommitdiff
path: root/src/3rdParty/efsw/Debug.hpp
blob: 78d35573b6287280bba57083e98eb8a5a9acbd5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef EFSW_DEBUG_HPP
#define EFSW_DEBUG_HPP

#include <efsw/base.hpp>

namespace efsw {

#ifdef DEBUG

void efREPORT_ASSERT( const char* File, const int Line, const char* Exp );

#define efASSERT( expr )                              \
	if ( !( expr ) ) {                                \
		efREPORT_ASSERT( __FILE__, __LINE__, #expr ); \
	}
#define efASSERTM( expr, msg )                       \
	if ( !( expr ) ) {                               \
		efREPORT_ASSERT( __FILE__, __LINE__, #msg ); \
	}

void efPRINT( const char* format, ... );
void efPRINTC( unsigned int cond, const char* format, ... );

#else

#define efASSERT( expr )
#define efASSERTM( expr, msg )

#ifndef EFSW_COMPILER_MSVC
#define efPRINT( format, args... ) \
	{}
#define efPRINTC( cond, format, args... ) \
	{}
#else
#define efPRINT
#define efPRINTC
#endif

#endif

#ifdef EFSW_VERBOSE
#define efDEBUG efPRINT
#define efDEBUGC efPRINTC
#else

#ifndef EFSW_COMPILER_MSVC
#define efDEBUG( format, args... ) \
	{}
#define efDEBUGC( cond, format, args... ) \
	{}
#else
#define efDEBUG
#define efDEBUGC
#endif

#endif

} // namespace efsw

#endif