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 <thomas.monjalon@6wind.com>
#include <rte_mbuf.h>
#include <rte_crypto.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
/** packet mbuf offload operation types */
enum rte_mbuf_ol_op_type {
__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;
}