Clean up debug features

Introduce a GTK_DEBUG_CHECK() macro and use it to check for
GTK_DEBUG flags everywhere. Also guard all such places by
This commit is contained in:
Matthias Clasen
2015-09-08 22:48:44 -04:00
parent 1b15588732
commit 3526b08e01
13 changed files with 107 additions and 72 deletions

View File

@ -59,12 +59,15 @@ typedef enum {
#ifdef G_ENABLE_DEBUG
#define GTK_NOTE(type,action) G_STMT_START { \
if (gtk_get_debug_flags () & GTK_DEBUG_##type) \
#define GTK_DEBUG_CHECK(type) G_UNLIKELY (gtk_get_debug_flags () & GTK_DEBUG_##type)
#define GTK_NOTE(type,action) G_STMT_START { \
if (GTK_DEBUG_CHECK (type)) \
{ action; }; } G_STMT_END
#else /* !G_ENABLE_DEBUG */
#define GTK_DEBUG_CHECK(type) 0
#define GTK_NOTE(type, action)
#endif /* G_ENABLE_DEBUG */