blob: 25bb8599c808d4d6d9a59ddb7b5e62e4246313a0 (
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
|
#ifndef debug_h_INCLUDED
#define debug_h_INCLUDED
#ifdef DEBUG
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define DP(x) puts(x)
#define DPn(name,x,len) \
do { \
char *__xxx = strndup(x,len); \
printf(name " [%s]\n",__xxx); \
free(__xxx); \
} while (0)
#define DPf(...) fprintf(stderr,__VA_ARGS__)
#else
#define DP(x)
#define DPn(n,x,l)
#define DPf(...)
#endif
#endif // debug_h_INCLUDED
|