[01/15] eal: use GCC and MSVC common VA ARGS extension

Message ID 1707774557-16012-2-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/eal/common/eal_trace.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Patch

diff --git a/lib/eal/common/eal_trace.h b/lib/eal/common/eal_trace.h
index bd082a0..79487a0 100644
--- a/lib/eal/common/eal_trace.h
+++ b/lib/eal/common/eal_trace.h
@@ -16,11 +16,11 @@ 
 #include "eal_private.h"
 #include "eal_thread.h"
 
-#define trace_err(fmt, args...) \
-	EAL_LOG(ERR, "%s():%u " fmt, __func__, __LINE__, ## args)
+#define trace_err(fmt, ...) \
+	EAL_LOG(ERR, "%s():%u " fmt, __func__, __LINE__, ## __VA_ARGS__)
 
-#define trace_crit(fmt, args...) \
-	EAL_LOG(CRIT, "%s():%u " fmt, __func__, __LINE__, ## args)
+#define trace_crit(fmt, ...) \
+	EAL_LOG(CRIT, "%s():%u " fmt, __func__, __LINE__, ## __VA_ARGS__)
 
 #define TRACE_CTF_MAGIC 0xC1FC1FC1
 #define TRACE_MAX_ARGS	32