1 #ifndef __JSON_DEBUG_H__
2 #define __JSON_DEBUG_H__
9 JSON_DEBUG_PARSER = 1 << 0,
10 JSON_DEBUG_GOBJECT = 1 << 1,
11 JSON_DEBUG_PATH = 1 << 2
14 #ifdef JSON_ENABLE_DEBUG
18 # define JSON_NOTE(type,x,a...) G_STMT_START { \
19 if (_json_get_debug_flags () & JSON_DEBUG_##type) { \
20 g_message ("[" #type "] " G_STRLOC ": " x, ##a); \
24 /* Try the C99 version; unfortunately, this does not allow us to pass
25 * empty arguments to the macro, which means we have to
26 * do an intemediate printf.
28 # define JSON_NOTE(type,...) G_STMT_START { \
29 if (_json_get_debug_flags () & JSON_DEBUG_##type) { \
30 gchar * _fmt = g_strdup_printf (__VA_ARGS__); \
31 g_message ("[" #type "] " G_STRLOC ": %s",_fmt); \
35 # endif /* __GNUC__ */
39 #define JSON_NOTE(type,...) G_STMT_START { } G_STMT_END
41 #endif /* JSON_ENABLE_DEBUG */
43 JsonDebugFlags _json_get_debug_flags (void);
47 #endif /* __JSON_DEBUG_H__ */