[PATCH 10/15] pdump: use GCC and MSVC common VA ARGS extension

Tyler Retzlaff roretzla at linux.microsoft.com
Mon Feb 12 22:49:12 CET 2024


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.

Signed-off-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
---
 lib/pdump/rte_pdump.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/pdump/rte_pdump.c b/lib/pdump/rte_pdump.c
index f6160f9..7717b54 100644
--- a/lib/pdump/rte_pdump.c
+++ b/lib/pdump/rte_pdump.c
@@ -18,8 +18,8 @@
 RTE_LOG_REGISTER_DEFAULT(pdump_logtype, NOTICE);
 #define RTE_LOGTYPE_PDUMP pdump_logtype
 
-#define PDUMP_LOG_LINE(level, fmt, args...) \
-	RTE_LOG_LINE(level, PDUMP, "%s(): " fmt, __func__, ## args)
+#define PDUMP_LOG_LINE(level, fmt, ...) \
+	RTE_LOG_LINE(level, PDUMP, "%s(): " fmt, __func__, ## __VA_ARGS__)
 
 /* Used for the multi-process communication */
 #define PDUMP_MP	"mp_pdump"
-- 
1.8.3.1



More information about the dev mailing list