From: Florin Coras Date: Mon, 28 Aug 2023 06:30:39 +0000 (-0700) Subject: session: fix compilation when SESSION_DEBUG is on X-Git-Tag: v24.02-rc0~51 X-Git-Url: https://gerrit.fd.io/r/gitweb?p=vpp.git;a=commitdiff_plain;h=1765f014bc7fcc3b924019ec96350eb50bef629f 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 --- 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...)