[14/15] stack: use GCC and MSVC common VA ARGS extension

Message ID 1707774557-16012-15-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.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 lib/stack/stack_pvt.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
  

Patch

diff --git a/lib/stack/stack_pvt.h b/lib/stack/stack_pvt.h
index 2dce42a..f38808b 100644
--- a/lib/stack/stack_pvt.h
+++ b/lib/stack/stack_pvt.h
@@ -10,16 +10,16 @@ 
 extern int stack_logtype;
 #define RTE_LOGTYPE_STACK stack_logtype
 
-#define STACK_LOG(level, fmt, args...) \
-	RTE_LOG_LINE(level, STACK, "%s(): "fmt, __func__, ##args)
+#define STACK_LOG(level, fmt, ...) \
+	RTE_LOG_LINE(level, STACK, "%s(): "fmt, __func__, ## __VA_ARGS__)
 
-#define STACK_LOG_ERR(fmt, args...) \
-	STACK_LOG(ERR, fmt, ## args)
+#define STACK_LOG_ERR(fmt, ...) \
+	STACK_LOG(ERR, fmt, ## __VA_ARGS__)
 
-#define STACK_LOG_WARN(fmt, args...) \
-	STACK_LOG(WARNING, fmt, ## args)
+#define STACK_LOG_WARN(fmt, ...) \
+	STACK_LOG(WARNING, fmt, ## __VA_ARGS__)
 
-#define STACK_LOG_INFO(fmt, args...) \
-	STACK_LOG(INFO, fmt, ## args)
+#define STACK_LOG_INFO(fmt, ...) \
+	STACK_LOG(INFO, fmt, ## __VA_ARGS__)
 
 #endif /* _STACK_PVT_H_ */