[PATCH v2 14/14] drivers/vdpa: use portable variadic macros
Andre Muezerie
andremue at linux.microsoft.com
Wed Dec 11 23:07:24 CET 2024
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 <andremue at linux.microsoft.com>
---
drivers/vdpa/ifc/base/ifcvf_osdep.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/vdpa/ifc/base/ifcvf_osdep.h b/drivers/vdpa/ifc/base/ifcvf_osdep.h
index ba7d684c25..bbbde153ee 100644
--- a/drivers/vdpa/ifc/base/ifcvf_osdep.h
+++ b/drivers/vdpa/ifc/base/ifcvf_osdep.h
@@ -16,8 +16,8 @@
extern int ifcvf_vdpa_logtype;
#define RTE_LOGTYPE_IFCVF_VDPA ifcvf_vdpa_logtype
-#define WARNINGOUT(S, args...) RTE_LOG(WARNING, IFCVF_VDPA, S, ##args)
-#define DEBUGOUT(S, args...) RTE_LOG(DEBUG, IFCVF_VDPA, S, ##args)
+#define WARNINGOUT(S, ...) RTE_LOG(WARNING, IFCVF_VDPA, S, ##__VA_ARGS__)
+#define DEBUGOUT(S, ...) RTE_LOG(DEBUG, IFCVF_VDPA, S, ##__VA_ARGS__)
#define STATIC static
#define msec_delay(x) rte_delay_us_sleep(1000 * (x))
--
2.47.0.vfs.0.3
More information about the dev
mailing list