original 1.0.1 release
[xwelltris.git] / src / include / mydebug.h
blob72feb82e14ff29d1add49913a2c474fc7311623b
1 #ifndef XNC_DEBUG_H
2 #define XNC_DEBUG_H
4 #include <config.h>
5 #ifdef HAVE_SYS_SIGEVENT_H
6 #include <sys/sigevent.h>
7 #endif
8 #include <stdio.h>
9 #include <stdarg.h>
11 #ifdef __cplusplus
12 extern "C" int debprintf(const char *format,...);
13 #else
14 extern int debprintf(const char *format,...);
15 #endif
17 #ifdef DEBUG_XNC
18 #ifdef __FILE__
19 #ifdef __LINE__
20 #define __DEBUG() fprintf(stderr, "%-17s:%4d ", __FILE__, __LINE__)
21 #endif
22 #endif
24 #ifndef __DEBUG
25 #define __DEBUG() ((void)0)
26 #endif
28 # define dbgprintf(x) do {__DEBUG(); debprintf x;} while(0)
29 #else
30 # define dbgprintf(x) ((void)0)
31 #endif
33 #endif