[12/15] rawdev: use GCC and MSVC common VA ARGS extension

Message ID 1707774557-16012-13-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/rawdev/rte_rawdev_pmd.h | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
  

Comments

Hemant Agrawal Feb. 13, 2024, 12:46 p.m. UTC | #1
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
  

Patch

diff --git a/lib/rawdev/rte_rawdev_pmd.h b/lib/rawdev/rte_rawdev_pmd.h
index 7173282..d66f438 100644
--- a/lib/rawdev/rte_rawdev_pmd.h
+++ b/lib/rawdev/rte_rawdev_pmd.h
@@ -30,15 +30,15 @@ 
 #define RTE_LOGTYPE_RAWDEV librawdev_logtype
 
 /* Logging Macros */
-#define RTE_RDEV_LOG(level, fmt, args...) \
-	RTE_LOG_LINE(level, RAWDEV, "%s(): " fmt, __func__, ##args)
-
-#define RTE_RDEV_ERR(fmt, args...) \
-	RTE_RDEV_LOG(ERR, fmt, ## args)
-#define RTE_RDEV_DEBUG(fmt, args...) \
-	RTE_RDEV_LOG(DEBUG, fmt, ## args)
-#define RTE_RDEV_INFO(fmt, args...) \
-	RTE_RDEV_LOG(INFO, fmt, ## args)
+#define RTE_RDEV_LOG(level, fmt, ...) \
+	RTE_LOG_LINE(level, RAWDEV, "%s(): " fmt, __func__, ## __VA_ARGS__)
+
+#define RTE_RDEV_ERR(fmt, ...) \
+	RTE_RDEV_LOG(ERR, fmt, ## __VA_ARGS__)
+#define RTE_RDEV_DEBUG(fmt, ...) \
+	RTE_RDEV_LOG(DEBUG, fmt, ## __VA_ARGS__)
+#define RTE_RDEV_INFO(fmt, ...) \
+	RTE_RDEV_LOG(INFO, fmt, ## __VA_ARGS__)
 
 
 /* Macros to check for valid device */