[08/15] mldev: use GCC and MSVC common VA ARGS extension

Message ID 1707774557-16012-9-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/mldev/rte_mldev.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Patch

diff --git a/lib/mldev/rte_mldev.h b/lib/mldev/rte_mldev.h
index 5cf6f05..e3ec889 100644
--- a/lib/mldev/rte_mldev.h
+++ b/lib/mldev/rte_mldev.h
@@ -146,8 +146,8 @@ 
 extern int rte_ml_dev_logtype;
 #define RTE_LOGTYPE_MLDEV rte_ml_dev_logtype
 
-#define RTE_MLDEV_LOG(level, fmt, args...) \
-	RTE_LOG_LINE(level, MLDEV, "%s(): " fmt, __func__, ##args)
+#define RTE_MLDEV_LOG(level, fmt, ...) \
+	RTE_LOG_LINE(level, MLDEV, "%s(): " fmt, __func__, ## __VA_ARGS__)
 
 #define RTE_ML_STR_MAX 128
 /**< Maximum length of name string */