macros: generate uniq variable name in _G_BOOLEAN_EXPR()/G_LIKELY()
@thom311
Submitted by Thomas Haller Link to original bug (#772743)
Description
This avoids a -Wshadow warning when nesting G_LIKELY() inside each other due to g_boolean_var.
This can be easily encountered when using macros:
#define GET_VALUE(arg) \
({ \
typeof (arg) _arg = (arg); \
\
g_assert (_arg); \
get_value (_arg); \
})
g_assert (GET_VALUE (a) > 5);
COUNTER is a GCC extension, but the definition of _G_BOOLEAN_EXPR() is already inside a #if defined(GNUC) && (GNUC > 2) && defined(OPTIMIZE) block.