From c7929ee79943f8c0408207c37895d4bc03aed094 Mon Sep 17 00:00:00 2001 From: Vivek Dasmohapatra Date: Thu, 26 May 2011 16:58:01 +0100 Subject: define MCP_DEBUG for plugins to use --- mission-control-plugins/debug-internal.h | 3 +-- mission-control-plugins/debug.h | 8 ++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/mission-control-plugins/debug-internal.h b/mission-control-plugins/debug-internal.h index d150e6c7..c02e86b7 100644 --- a/mission-control-plugins/debug-internal.h +++ b/mission-control-plugins/debug-internal.h @@ -33,8 +33,7 @@ #ifdef ENABLE_DEBUG #define DEBUG(format, ...) \ - if (mcp_debugging (MCP_DEBUG_TYPE)) \ - g_debug ("%s: " format, G_STRLOC, ##__VA_ARGS__) + MCP_DEBUG (MCP_DEBUG_TYPE, format, ##__VA_ARGS__) #else diff --git a/mission-control-plugins/debug.h b/mission-control-plugins/debug.h index 14a52099..909631c1 100644 --- a/mission-control-plugins/debug.h +++ b/mission-control-plugins/debug.h @@ -21,6 +21,14 @@ #ifndef MCP_DEBUG_H #define MCP_DEBUG_H +#ifndef _MCP_IN_MISSION_CONTROL_PLUGINS_H +#error Use instead +#endif + +#define MCP_DEBUG(_type, _fmt, ...) \ + G_STMT_START { if (mcp_is_debugging (_type)) \ + g_debug ("%s: " _fmt, G_STRLOC, ##__VA_ARGS__); } G_STMT_END + G_BEGIN_DECLS typedef enum { -- cgit v1.2.1