From 1765f014bc7fcc3b924019ec96350eb50bef629f Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Sun, 27 Aug 2023 23:30:39 -0700 Subject: 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 Change-Id: I35af179b806ed47a1e20816a19291c31fdb7566a --- src/vnet/session/session_debug.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/vnet/session/session_debug.h b/src/vnet/session/session_debug.h index 45dd77c7e45..d433ef47fb1 100644 --- a/src/vnet/session/session_debug.h +++ b/src/vnet/session/session_debug.h @@ -396,9 +396,13 @@ extern session_dbg_main_t session_dbg_main; #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...) -- cgit 1.2.3-korg