[05/15] ip_frag: use GCC and MSVC common VA ARGS extension

Message ID 1707774557-16012-6-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series use GCC/MSVC compatible __VA_ARGS__ |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Tyler Retzlaff Feb. 12, 2024, 9:49 p.m. UTC
  Use ... and forward with __VA_ARGS__ instead of args... and args.
Neither mechanism is conformant with the standard but the former works
with both GCC and MSVC.

Fix checkpatches warning about style while(0) -> while (0)

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 lib/ip_frag/ip_frag_common.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Patch

diff --git a/lib/ip_frag/ip_frag_common.h b/lib/ip_frag/ip_frag_common.h
index c766154..8926dc6 100644
--- a/lib/ip_frag/ip_frag_common.h
+++ b/lib/ip_frag/ip_frag_common.h
@@ -26,9 +26,9 @@ 
 	RTE_LOG_LINE(level, IPFRAG, "" __VA_ARGS__)
 
 #ifdef RTE_LIBRTE_IP_FRAG_DEBUG
-#define	IP_FRAG_LOG(lvl, fmt, args...)	RTE_LOG(lvl, IPFRAG, fmt, ##args)
+#define	IP_FRAG_LOG(lvl, fmt, ...)	RTE_LOG(lvl, IPFRAG, fmt, ## __VA_ARGS__)
 #else
-#define	IP_FRAG_LOG(lvl, fmt, args...)	do {} while(0)
+#define	IP_FRAG_LOG(lvl, fmt, ...)	do {} while (0)
 #endif /* IP_FRAG_DEBUG */
 
 #define IPV4_KEYLEN 1