-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdebugMacros.h
40 lines (32 loc) · 898 Bytes
/
debugMacros.h
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
/**
* @Author: Izhar Shaikh
* @Date: 2017-02-07T14:46:31-05:00
* @Last modified by: Izhar
* @Last modified time: 2017-02-07T15:25:57-05:00
*/
#ifndef __DEBUG_MACROS__
#define __DEBUG_MACROS__
#include <stdio.h>
#ifdef DEBUG
#define DEBUG_TEST 1
#else
#define DEBUG_TEST 0
#endif
#define SUCCESS 0
#define FAIL 1
#define dbg_trace(fmt, ...) \
do { if(DEBUG_TEST) \
fprintf(stderr, \
"DEBUG:%d: %s(): " fmt, \
__LINE__, __func__, __VA_ARGS__); \
} while(0)
#define dbg_info(fmt, ...) \
do { if(DEBUG_TEST) \
fprintf(stderr, \
"INFO:%d: %s(): " fmt, \
__LINE__, __func__ ); \
} while(0)
#define print_output(fmt, ...) \
do { fprintf(stdout, fmt, __VA_ARGS__); \
} while(0)
#endif