-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeb.h
More file actions
40 lines (32 loc) · 681 Bytes
/
Copy pathDeb.h
File metadata and controls
40 lines (32 loc) · 681 Bytes
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
// MT, 2016feb29
#ifndef MT_DEB
#define MT_DEB
#include <stdio.h>
#ifdef NDEBUG
#define MT_DEB_ACTIVE 0
#else
#define MT_DEB_ACTIVE 1
#endif
#ifdef __cplusplus
extern "C" {
#endif
// Original source code: http://stackoverflow.com/questions/1644868/c-define-macro-for-debug-printing
//
#define Deb_line(fmt, ...) \
do \
{ \
if(MT_DEB_ACTIVE) \
{ \
fprintf( \
stderr, \
"DEBUG: %s, %d, %s() : " fmt "\n", \
__FILE__, \
__LINE__, \
__func__, \
##__VA_ARGS__); \
} \
}while(0);
#ifdef __cplusplus
}
#endif
#endif // MT_DEBUG