[02/15] bpf: use GCC and MSVC common VA ARGS extension

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

Patch

diff --git a/lib/bpf/bpf_impl.h b/lib/bpf/bpf_impl.h
index 1a3d97d..e4871bc 100644
--- a/lib/bpf/bpf_impl.h
+++ b/lib/bpf/bpf_impl.h
@@ -29,8 +29,8 @@  struct rte_bpf {
 extern int rte_bpf_logtype;
 #define RTE_LOGTYPE_BPF rte_bpf_logtype
 
-#define	RTE_BPF_LOG_LINE(lvl, fmt, args...) \
-	RTE_LOG_LINE(lvl, BPF, fmt, ##args)
+#define	RTE_BPF_LOG_LINE(lvl, fmt, ...) \
+	RTE_LOG_LINE(lvl, BPF, fmt, ## __VA_ARGS__)
 
 static inline size_t
 bpf_size(uint32_t bpf_op_sz)