From: Adrien Mazarguil Date: Wed, 26 Apr 2017 12:07:10 +0000 (+0200) Subject: eventdev: fix headers for strict compilation flags X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=507fb14c2a6b18d3ff98fb231cbc78b291bcbe5e;p=dpdk.git eventdev: fix headers for strict compilation flags Exported headers must allow compilation with the strictest flags. This commit addresses the following errors: In file included from build/include/rte_eventdev_pmd.h:55:0, from /tmp/check-includes.sh.25816.c:1: build/include/rte_eventdev.h:908:8: error: struct has no named members [-Werror=pedantic] [...] In file included from /tmp/check-includes.sh.25816.c:1:0: build/include/rte_eventdev_pmd.h:65:35: error: ISO C does not permit named variadic macros [-Werror=variadic-macros] [...] Fixes: 71f238432865 ("eventdev: introduce event driven programming model") Fixes: 4f0804bbdfb9 ("eventdev: implement the northbound APIs") Signed-off-by: Adrien Mazarguil Acked-by: Jerin Jacob --- diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h index b8ed6ef085..20e7293e08 100644 --- a/lib/librte_eventdev/rte_eventdev.h +++ b/lib/librte_eventdev/rte_eventdev.h @@ -905,9 +905,9 @@ rte_event_dev_close(uint8_t dev_id); * The generic *rte_event* structure to hold the event attributes * for dequeue and enqueue operation */ +RTE_STD_C11 struct rte_event { /** WORD0 */ - RTE_STD_C11 union { uint64_t event; /** Event attributes for dequeue or enqueue operation */ @@ -967,7 +967,6 @@ struct rte_event { }; }; /** WORD1 */ - RTE_STD_C11 union { uint64_t u64; /**< Opaque 64-bit value */ diff --git a/lib/librte_eventdev/rte_eventdev_pmd.h b/lib/librte_eventdev/rte_eventdev_pmd.h index f898ea77f8..4005b3c98c 100644 --- a/lib/librte_eventdev/rte_eventdev_pmd.h +++ b/lib/librte_eventdev/rte_eventdev_pmd.h @@ -55,16 +55,18 @@ extern "C" { #include "rte_eventdev.h" /* Logging Macros */ -#define RTE_EDEV_LOG_ERR(fmt, args...) \ - RTE_LOG(ERR, EVENTDEV, "%s() line %u: " fmt "\n", \ - __func__, __LINE__, ## args) +#define RTE_EDEV_LOG_ERR(...) \ + RTE_LOG(ERR, EVENTDEV, \ + RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \ + __func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__,))) #ifdef RTE_LIBRTE_EVENTDEV_DEBUG -#define RTE_EDEV_LOG_DEBUG(fmt, args...) \ - RTE_LOG(DEBUG, EVENTDEV, "%s() line %u: " fmt "\n", \ - __func__, __LINE__, ## args) +#define RTE_EDEV_LOG_DEBUG(...) \ + RTE_LOG(DEBUG, EVENTDEV, \ + RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \ + __func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__,))) #else -#define RTE_EDEV_LOG_DEBUG(fmt, args...) (void)0 +#define RTE_EDEV_LOG_DEBUG(...) (void)0 #endif /* Macros to check for valid device */