From: Thomas Monjalon Date: Fri, 5 Feb 2016 16:51:19 +0000 (+0100) Subject: mbuf_offload: fix header for C++ X-Git-Tag: spdx-start~7602 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=43cb19a52632c404994bd25e4bf7b771665742eb;p=dpdk.git mbuf_offload: fix header for C++ 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 --- 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; }