mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-29 02:50:04 +01:00
G_LIKELY/_UNLIKELY macros need more parentheses
...for cases like #include "glib.h" #define COMMA , void f(void) { if (G_LIKELY(0 COMMA 1)); } https://bugzilla.gnome.org/show_bug.cgi?id=760215
This commit is contained in:
parent
e91e811f02
commit
b44fba25fb
@ -354,8 +354,8 @@
|
||||
_g_boolean_var_ = 0; \
|
||||
_g_boolean_var_; \
|
||||
})
|
||||
#define G_LIKELY(expr) (__builtin_expect (_G_BOOLEAN_EXPR(expr), 1))
|
||||
#define G_UNLIKELY(expr) (__builtin_expect (_G_BOOLEAN_EXPR(expr), 0))
|
||||
#define G_LIKELY(expr) (__builtin_expect (_G_BOOLEAN_EXPR((expr)), 1))
|
||||
#define G_UNLIKELY(expr) (__builtin_expect (_G_BOOLEAN_EXPR((expr)), 0))
|
||||
#else
|
||||
#define G_LIKELY(expr) (expr)
|
||||
#define G_UNLIKELY(expr) (expr)
|
||||
|
Loading…
x
Reference in New Issue
Block a user