Many places are using a GCC extension related to variadic macros,
where a name prepends the ellipsis. This results in a warning like
the one below when compiling the code with MSVC:

app\test-pmd\testpmd.h(1314): error C2608:
    invalid token '...' in macro parameter list

Variadic macros became a standard part of the C language with C99.
GCC, Clang and MSVC handle them properly.

The fix is to remove the prefix name (args... becomes ...) and use
__VA_ARGS__.

Signed-off-by: Andre Muezerie <andre...@linux.microsoft.com>
---
 drivers/event/dlb2/dlb2_log.h             |  8 ++++----
 drivers/event/dlb2/pf/base/dlb2_osdep.h   | 12 ++++++------
 drivers/event/dpaa/dpaa_eventdev.h        | 16 ++++++++--------
 drivers/event/dpaa2/dpaa2_eventdev_logs.h | 12 ++++++------
 drivers/event/dsw/dsw_evdev.h             |  8 ++++----
 drivers/event/sw/sw_evdev_log.h           | 12 ++++++------
 6 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/drivers/event/dlb2/dlb2_log.h b/drivers/event/dlb2/dlb2_log.h
index c9ce87681c..321ecdfd05 100644
--- a/drivers/event/dlb2/dlb2_log.h
+++ b/drivers/event/dlb2/dlb2_log.h
@@ -12,11 +12,11 @@ extern int eventdev_dlb2_log_level;
 #define DLB2_LOG_IMPL(level, ...) \
        RTE_LOG_LINE_PREFIX(level, EVENTDEV_DLB2, "%s", __func__, __VA_ARGS__)
 
-#define DLB2_LOG_INFO(fmt, args...) \
-       DLB2_LOG_IMPL(INFO, fmt, ## args)
+#define DLB2_LOG_INFO(fmt, ...) \
+       DLB2_LOG_IMPL(INFO, fmt, ## __VA_ARGS__)
 
-#define DLB2_LOG_ERR(fmt, args...) \
-       DLB2_LOG_IMPL(ERR, fmt, ## args)
+#define DLB2_LOG_ERR(fmt, ...) \
+       DLB2_LOG_IMPL(ERR, fmt, ## __VA_ARGS__)
 
 /* remove debug logs at compile time unless actually debugging */
 #define DLB2_LOG_LINE_DBG(...) \
diff --git a/drivers/event/dlb2/pf/base/dlb2_osdep.h 
b/drivers/event/dlb2/pf/base/dlb2_osdep.h
index 16c5e3b797..382a49090a 100644
--- a/drivers/event/dlb2/pf/base/dlb2_osdep.h
+++ b/drivers/event/dlb2/pf/base/dlb2_osdep.h
@@ -40,14 +40,14 @@
        DLB2_PCI_REG_WRITE(DLB2_FUNC_REG_ADDR((hw), (reg)), (value))
 
 /* Map to PMDs logging interface */
-#define DLB2_ERR(dev, fmt, args...) \
-       RTE_LOG(ERR, EVENTDEV_DLB2, "%s" fmt, __func__, ## args)
+#define DLB2_ERR(dev, fmt, ...) \
+       RTE_LOG(ERR, EVENTDEV_DLB2, "%s" fmt, __func__, ## __VA_ARGS__)
 
-#define DLB2_INFO(dev, fmt, args...) \
-       RTE_LOG(INFO, EVENTDEV_DLB2, "%s" fmt, __func__, ## args)
+#define DLB2_INFO(dev, fmt, ...) \
+       RTE_LOG(INFO, EVENTDEV_DLB2, "%s" fmt, __func__, ## __VA_ARGS__)
 
-#define DLB2_DEBUG(dev, fmt, args...) \
-       RTE_LOG_DP(DEBUG, EVENTDEV_DLB2, fmt, ## args)
+#define DLB2_DEBUG(dev, fmt, ...) \
+       RTE_LOG_DP(DEBUG, EVENTDEV_DLB2, fmt, ## __VA_ARGS__)
 
 /**
  * os_udelay() - busy-wait for a number of microseconds
diff --git a/drivers/event/dpaa/dpaa_eventdev.h 
b/drivers/event/dpaa/dpaa_eventdev.h
index 5831ccb4e8..047c9781bd 100644
--- a/drivers/event/dpaa/dpaa_eventdev.h
+++ b/drivers/event/dpaa/dpaa_eventdev.h
@@ -82,13 +82,13 @@ struct dpaa_eventdev {
 
 #define EVENTDEV_INIT_FUNC_TRACE() DPAA_EVENTDEV_LOG(DEBUG, " >>")
 
-#define DPAA_EVENTDEV_DEBUG(fmt, args...) \
-       DPAA_EVENTDEV_LOG(DEBUG, fmt, ## args)
-#define DPAA_EVENTDEV_ERR(fmt, args...) \
-       DPAA_EVENTDEV_LOG(ERR, fmt, ## args)
-#define DPAA_EVENTDEV_INFO(fmt, args...) \
-       DPAA_EVENTDEV_LOG(INFO, fmt, ## args)
-#define DPAA_EVENTDEV_WARN(fmt, args...) \
-       DPAA_EVENTDEV_LOG(WARNING, fmt, ## args)
+#define DPAA_EVENTDEV_DEBUG(fmt, ...) \
+       DPAA_EVENTDEV_LOG(DEBUG, fmt, ## __VA_ARGS__)
+#define DPAA_EVENTDEV_ERR(fmt, ...) \
+       DPAA_EVENTDEV_LOG(ERR, fmt, ## __VA_ARGS__)
+#define DPAA_EVENTDEV_INFO(fmt, ...) \
+       DPAA_EVENTDEV_LOG(INFO, fmt, ## __VA_ARGS__)
+#define DPAA_EVENTDEV_WARN(fmt, ...) \
+       DPAA_EVENTDEV_LOG(WARNING, fmt, ## __VA_ARGS__)
 
 #endif /* __DPAA_EVENTDEV_H__ */
diff --git a/drivers/event/dpaa2/dpaa2_eventdev_logs.h 
b/drivers/event/dpaa2/dpaa2_eventdev_logs.h
index 12317ae39f..7145ac30b9 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev_logs.h
+++ b/drivers/event/dpaa2/dpaa2_eventdev_logs.h
@@ -16,12 +16,12 @@ extern int dpaa2_logtype_event;
 
 #define EVENTDEV_INIT_FUNC_TRACE() DPAA2_EVENTDEV_DEBUG(" >>")
 
-#define DPAA2_EVENTDEV_INFO(fmt, args...) \
-       DPAA2_EVENTDEV_LOG(INFO, fmt, ## args)
-#define DPAA2_EVENTDEV_ERR(fmt, args...) \
-       DPAA2_EVENTDEV_LOG(ERR, fmt, ## args)
-#define DPAA2_EVENTDEV_WARN(fmt, args...) \
-       DPAA2_EVENTDEV_LOG(WARNING, fmt, ## args)
+#define DPAA2_EVENTDEV_INFO(fmt, ...) \
+       DPAA2_EVENTDEV_LOG(INFO, fmt, ## __VA_ARGS__)
+#define DPAA2_EVENTDEV_ERR(fmt, ...) \
+       DPAA2_EVENTDEV_LOG(ERR, fmt, ## __VA_ARGS__)
+#define DPAA2_EVENTDEV_WARN(fmt, ...) \
+       DPAA2_EVENTDEV_LOG(WARNING, fmt, ## __VA_ARGS__)
 
 #define dpaa2_evdev_info(fmt, ...) DPAA2_EVENTDEV_LOG(INFO, fmt, ##__VA_ARGS__)
 #define dpaa2_evdev_dbg(fmt, ...) DPAA2_EVENTDEV_LOG(DEBUG, fmt, ##__VA_ARGS__)
diff --git a/drivers/event/dsw/dsw_evdev.h b/drivers/event/dsw/dsw_evdev.h
index ce52498435..6b75bb13e3 100644
--- a/drivers/event/dsw/dsw_evdev.h
+++ b/drivers/event/dsw/dsw_evdev.h
@@ -303,11 +303,11 @@ dsw_pmd_priv(const struct rte_eventdev *eventdev)
 
 extern int event_dsw_logtype;
 #define RTE_LOGTYPE_EVENT_DSW event_dsw_logtype
-#define DSW_LOG_DP_LINE(level, fmt, args...)                           \
+#define DSW_LOG_DP_LINE(level, fmt, ...)                               \
        RTE_LOG_DP_LINE(level, EVENT_DSW, "%s() line %u: " fmt,         \
-                  __func__, __LINE__, ## args)
+                  __func__, __LINE__, ## __VA_ARGS__)
 
-#define DSW_LOG_DP_PORT_LINE(level, port_id, fmt, args...)             \
-       DSW_LOG_DP_LINE(level, "<Port %d> " fmt, port_id, ## args)
+#define DSW_LOG_DP_PORT_LINE(level, port_id, fmt, ...)         \
+       DSW_LOG_DP_LINE(level, "<Port %d> " fmt, port_id, ## __VA_ARGS__)
 
 #endif
diff --git a/drivers/event/sw/sw_evdev_log.h b/drivers/event/sw/sw_evdev_log.h
index 50a707939c..68c18b3d07 100644
--- a/drivers/event/sw/sw_evdev_log.h
+++ b/drivers/event/sw/sw_evdev_log.h
@@ -11,13 +11,13 @@ extern int eventdev_sw_log_level;
 #define SW_LOG_IMPL(level, ...) \
        RTE_LOG_LINE_PREFIX(level, EVENT_SW, "%s", __func__, __VA_ARGS__)
 
-#define SW_LOG_INFO(fmt, args...) \
-       SW_LOG_IMPL(INFO, fmt, ## args)
+#define SW_LOG_INFO(fmt, ...) \
+       SW_LOG_IMPL(INFO, fmt, ## __VA_ARGS__)
 
-#define SW_LOG_DBG(fmt, args...) \
-       SW_LOG_IMPL(DEBUG, fmt, ## args)
+#define SW_LOG_DBG(fmt, ...) \
+       SW_LOG_IMPL(DEBUG, fmt, ## __VA_ARGS__)
 
-#define SW_LOG_ERR(fmt, args...) \
-       SW_LOG_IMPL(ERR, fmt, ## args)
+#define SW_LOG_ERR(fmt, ...) \
+       SW_LOG_IMPL(ERR, fmt, ## __VA_ARGS__)
 
 #endif /* _SW_EVDEV_LOG_H_ */
-- 
2.47.0.vfs.0.3

Reply via email to