[sundance] Add reset completion check
[gpxe.git] / src / include / debug.h
blobbb5d33f3c34db357afb2a501bef9ba7e500d957f
1 #ifndef DEBUG_H
2 #define DEBUG_H
4 //#include <lib.h>
5 extern int last_putchar;
7 /* Defining DEBUG_THIS before including this file enables debug() macro
8 * for the file. DEBUG_ALL is for global control. */
10 #if DEBUG_THIS || DEBUG_ALL
11 #define DEBUG 1
12 #else
13 #undef DEBUG
14 #endif
16 #if DEBUG
17 # define debug(...) \
18 ((last_putchar=='\n' ? printf("%s: ", __FUNCTION__) : 0), \
19 printf(__VA_ARGS__))
20 # define debug_hexdump hexdump
21 #else
22 # define debug(...) /* nothing */
23 # define debug_hexdump(...) /* nothing */
24 #endif
26 #define debugx debug
28 #endif /* DEBUG_H */