Skip to content

Commit 43cb19a

Browse files
author
Thomas Monjalon
committed
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: 78c8709 ("mbuf_offload: introduce library to attach offloads to mbuf") Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
1 parent fa2f06b commit 43cb19a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/librte_mbuf_offload/rte_mbuf_offload.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@
5959
#include <rte_mbuf.h>
6060
#include <rte_crypto.h>
6161

62+
#ifdef __cplusplus
63+
extern "C" {
64+
#endif
6265

6366
/** packet mbuf offload operation types */
6467
enum rte_mbuf_ol_op_type {
@@ -125,7 +128,7 @@ static inline uint16_t
125128
__rte_pktmbuf_offload_priv_size(struct rte_mempool *mpool)
126129
{
127130
struct rte_pktmbuf_offload_pool_private *priv =
128-
rte_mempool_get_priv(mpool);
131+
(struct rte_pktmbuf_offload_pool_private *)rte_mempool_get_priv(mpool);
129132

130133
return priv->offload_priv_size;
131134
}

0 commit comments

Comments
 (0)