From 43cb19a52632c404994bd25e4bf7b771665742eb Mon Sep 17 00:00:00 2001 From: Thomas Monjalon Date: Fri, 5 Feb 2016 17:51:19 +0100 Subject: [PATCH] mbuf_offload: fix header for C++ MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When built in a C++ application, the include fails for 2 reasons: rte_mbuf_offload.h:128:24: error: invalid conversion from ‘void*’ to ‘rte_pktmbuf_offload_pool_private*’ [-fpermissive] rte_mempool_get_priv(mpool); ^ The cast must be explicit for C++. rte_mbuf_offload.h:304:1: error: expected declaration before ‘}’ token There was a closing brace for __cplusplus but not an opening one. Fixes: 78c8709b5ddb ("mbuf_offload: introduce library to attach offloads to mbuf") Signed-off-by: Thomas Monjalon --- lib/librte_mbuf_offload/rte_mbuf_offload.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/librte_mbuf_offload/rte_mbuf_offload.h b/lib/librte_mbuf_offload/rte_mbuf_offload.h index 4345f06919..77993b642e 100644 --- a/lib/librte_mbuf_offload/rte_mbuf_offload.h +++ b/lib/librte_mbuf_offload/rte_mbuf_offload.h @@ -59,6 +59,9 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif /** packet mbuf offload operation types */ enum rte_mbuf_ol_op_type { @@ -125,7 +128,7 @@ static inline uint16_t __rte_pktmbuf_offload_priv_size(struct rte_mempool *mpool) { struct rte_pktmbuf_offload_pool_private *priv = - rte_mempool_get_priv(mpool); + (struct rte_pktmbuf_offload_pool_private *)rte_mempool_get_priv(mpool); return priv->offload_priv_size; } -- 2.20.1