member: fix ISO C in exported header
authorAdrien Mazarguil <adrien.mazarguil@6wind.com>
Thu, 21 Dec 2017 13:00:02 +0000 (14:00 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 16 Jan 2018 23:27:51 +0000 (00:27 +0100)
Reported by check-includes.sh:

 [...]/rte_member.h:107:40: error: ISO C does not permit named variadic
     macros [-Werror=variadic-macros]
  #define RTE_MEMBER_LOG(level, fmt, args...) \
                                         ^

Fixes: 857ed6c68cf2 ("member: implement main API")
Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
lib/librte_member/rte_member.h

index 2ffb6db..b778767 100644 (file)
@@ -51,6 +51,8 @@ extern "C" {
 
 #include <stdint.h>
 
+#include <rte_common.h>
+
 /** The set ID type that stored internally in hash table based set summary. */
 typedef uint16_t member_set_t;
 /** Invalid set ID used to mean no match found. */
@@ -75,9 +77,12 @@ typedef uint16_t member_set_t;
 
 extern int librte_member_logtype;
 
-#define RTE_MEMBER_LOG(level, fmt, args...) \
-rte_log(RTE_LOG_ ## level, librte_member_logtype, "%s(): " fmt, \
-       __func__, ## args)
+#define RTE_MEMBER_LOG(level, ...) \
+       rte_log(RTE_LOG_ ## level, \
+               librte_member_logtype, \
+               RTE_FMT("%s(): " RTE_FMT_HEAD(__VA_ARGS__,), \
+                       __func__, \
+                       RTE_FMT_TAIL(__VA_ARGS__,)))
 
 /** @internal setsummary structure. */
 struct rte_member_setsum;