diff options
-rw-r--r-- | mission-control-plugins/debug-internal.h | 3 | ||||
-rw-r--r-- | 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 <mission-control-plugins/mission-control-plugins.h> 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 { |