--- np2/x11/trace.h 2004/01/13 16:29:11 1.3 +++ np2/x11/trace.h 2011/01/15 19:16:58 1.7 @@ -1,6 +1,14 @@ #ifndef NP2_X11_TRACE_H__ #define NP2_X11_TRACE_H__ +G_BEGIN_DECLS + +extern int trace_flag; + +void trace_init(void); +void trace_term(void); +void trace_fmt(const char *str, ...) G_GNUC_PRINTF(1, 2); + #ifndef TRACE #define TRACEINIT() @@ -10,27 +18,17 @@ #define VERBOSE(s) #endif -#else - -#ifdef __cplusplus -extern "C" { -#endif - -void trace_init(void); -void trace_term(void); -void trace_fmt(const char *str, ...); +#else /* TRACE */ -#define TRACEINIT() trace_init() -#define TRACETERM() trace_term() +#define TRACEINIT() trace_init() +#define TRACETERM() trace_term() #define TRACEOUT(arg) trace_fmt arg #ifndef VERBOSE -#define VERBOSE(arg) trace_fmt arg +#define VERBOSE(arg) if (trace_flag) trace_fmt arg #endif -#ifdef __cplusplus -}; -#endif +#endif /* !TRACE */ -#endif +G_END_DECLS #endif /* NP2_X11_TRACE_H__ */