diff --git a/include/glibtop/error.h b/include/glibtop/error.h index 76e1abe8..fdce2fd3 100644 --- a/include/glibtop/error.h +++ b/include/glibtop/error.h @@ -47,14 +47,16 @@ void glibtop_error_io (const char *format, ...) G_GNUC_PRINTF(1, 2) G_GNUC_NORET void glibtop_warn_io (const char *format, ...) G_GNUC_PRINTF(1, 2); /* FIXME: C99 */ -#define glibtop_debug(fmt, ...) \ +#define glibtop_debug_r(server, fmt, ...) \ G_STMT_START { \ if (LIBGTOP_ENABLE_DEBUG) \ - glibtop_debug_r(glibtop_global_server, fmt, ##__VA_ARGS__); \ + glibtop_debug_r_real(server, fmt, ##__VA_ARGS__); \ } G_STMT_END +#define glibtop_debug(...) glibtop_debug_r(glibtop_global_server, __VA_ARGS__) + void glibtop_debug_vr (glibtop *server, const char *format, va_list args); -void glibtop_debug_r (glibtop *server, const char *format, ...) G_GNUC_PRINTF(2, 3); +void glibtop_debug_r_real (glibtop *server, const char *format, ...) G_GNUC_PRINTF(2, 3); G_END_DECLS diff --git a/sysdeps/common/error.c b/sysdeps/common/error.c index 12363d40..6ef238e6 100644 --- a/sysdeps/common/error.c +++ b/sysdeps/common/error.c @@ -174,7 +174,7 @@ glibtop_debug_vr (glibtop *server, const char *format, va_list args) } void -glibtop_debug_r (glibtop *server, const char *format, ...) +glibtop_debug_r_real (glibtop *server, const char *format, ...) { va_list args;