Commit b44fba25 authored by stbergmann's avatar stbergmann Committed by Colin Walters

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
parent e91e811f
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment