forked from derekalyne/small-linux-kernel-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdebug.h
33 lines (26 loc) · 884 Bytes
/
debug.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
/* debug.h - Useful macros for debugging
* vim:ts=4 noexpandtab
*/
#ifndef _DEBUG_H
#define _DEBUG_H
#ifndef ASM
#ifdef DEBUG
#define ASSERT(EXP) \
do { \
if (!(EXP)) { \
printf(__FILE__ ":%u: Assertion `" #EXP "\' failed.\n", __LINE__); \
} \
} while(0)
#define debugf(...) \
do { \
printf(__FILE__ ":%u: ", __LINE__); \
printf(__VA_ARGS__); \
} while(0)
#else
#define ASSERT(EXP) \
while (0)
#define debugf(...) \
while (0)
#endif
#endif
#endif /* _DEBUG_H */