session: fix compilation when SESSION_DEBUG is on
Wrap SESSION_EVT in do loop to avoid complaints about if statement
having no arguments which can happen if debugging for groups is not
enabled.
Type: fix
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I35af179b806ed47a1e20816a19291c31fdb7566a
diff --git a/src/vnet/session/session_debug.h b/src/vnet/session/session_debug.h
index 45dd77c..d433ef4 100644
--- a/src/vnet/session/session_debug.h
+++ b/src/vnet/session/session_debug.h
@@ -396,9 +396,13 @@
#define session_evt_grp_dbg_lvl(_evt) \
session_dbg_main.grp_dbg_lvl[session_evt_grp (_evt)]
#define SESSION_EVT(_evt, _args...) \
- if (PREDICT_FALSE (session_evt_grp_dbg_lvl (_evt) >= \
- session_evt_lvl (_evt))) \
- CC (_evt, _HANDLER) (_args)
+ do \
+ { \
+ if (PREDICT_FALSE (session_evt_grp_dbg_lvl (_evt) >= \
+ session_evt_lvl (_evt))) \
+ CC (_evt, _HANDLER) (_args); \
+ } \
+ while (0)
#else
#define SESSION_EVT(_evt, _args...)
#define SESSION_DBG(_fmt, _args...)