[07/15] metrics: use GCC and MSVC common VA ARGS extension

Message ID 1707774557-16012-8-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
State New
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/metrics/rte_metrics_telemetry.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
  

Patch

diff --git a/lib/metrics/rte_metrics_telemetry.c b/lib/metrics/rte_metrics_telemetry.c
index b8c9d75..0f26726 100644
--- a/lib/metrics/rte_metrics_telemetry.c
+++ b/lib/metrics/rte_metrics_telemetry.c
@@ -19,14 +19,14 @@ 
 #define RTE_LOGTYPE_METRICS metrics_log_level
 
 /* Logging Macros */
-#define METRICS_LOG(level, fmt, args...) \
-	RTE_LOG_LINE(level, METRICS, "%s(): "fmt, __func__, ## args)
+#define METRICS_LOG(level, fmt, ...) \
+	RTE_LOG_LINE(level, METRICS, "%s(): "fmt, __func__, ## __VA_ARGS__)
 
-#define METRICS_LOG_ERR(fmt, args...) \
-	METRICS_LOG(ERR, fmt, ## args)
+#define METRICS_LOG_ERR(fmt, ...) \
+	METRICS_LOG(ERR, fmt, ## __VA_ARGS__)
 
-#define METRICS_LOG_WARN(fmt, args...) \
-	METRICS_LOG(WARNING, fmt, ## args)
+#define METRICS_LOG_WARN(fmt, ...) \
+	METRICS_LOG(WARNING, fmt, ## __VA_ARGS__)
 
 static int32_t
 rte_metrics_tel_reg_port_ethdev_to_metrics(uint16_t port_id)