1 #ifndef _included_dxlog_h_
2 #define _included_dxlog_h_
3 
4 #include "system.h"
5 
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9 
10 #if debug
11 
12 void dx_err_log(int error, int line, char const * file);
13 void dx_str_log(char const * str, int line, char const * file);
14 void dx_line_log(int line, char const * file);
15 void dx_strf_log(char const * fmt, ...);
16 
17 #define LOGDXERR(error) dx_err_log(error,__LINE__,__FILE__)
18 #define LOGDXSTR(str) dx_str_log(str,__LINE__,__FILE__)
19 #define LOGDXFMT(args) (dx_line_log(__LINE__,__FILE__),dx_strf_log args)
20 
21 #else
22 
23 /* TODO: make these static inline to hush the compiler */
24 void dx_err_log(int error, int line, char const * file);
25 void dx_str_log(char const * str, int line, char const * file);
26 void dx_line_log(int line, char const * file);
27 void dx_strf_log(char const * fmt, ...);
28 
29 #define LOGDXERR(error) dx_err_log(error,__LINE__,__FILE__)
30 #define LOGDXSTR(str) dx_str_log(str,__LINE__,__FILE__)
31 #define LOGDXFMT(args) (dx_line_log(__LINE__,__FILE__),dx_strf_log args)
32 
33 /*
34 #define LOGDXERR(error) (void)0
35 #define LOGDXSTR(str) (void)0
36 #define LOGDXFMT(args) (void)0
37 */
38 #endif
39 
40 
41 #ifdef __cplusplus
42 }
43 #endif
44 
45 #endif /* ! _included_dxlog_h_ */
46