From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: [PATCH v2 3/3] mbuf_offload: fix header for C++ Date: Tue, 16 Feb 2016 08:14:25 +0100 Message-ID: <1455606865-22680-4-git-send-email-thomas.monjalon@6wind.com> References: <1454691969-25734-1-git-send-email-thomas.monjalon@6wind.com> <1455606865-22680-1-git-send-email-thomas.monjalon@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org To: pablo.de.lara.guarch@intel.com, declan.doherty@intel.com, remy.horton@intel.com Return-path: Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by dpdk.org (Postfix) with ESMTP id A49FDC130 for ; Tue, 16 Feb 2016 08:16:09 +0100 (CET) Received: by mail-wm0-f44.google.com with SMTP id g62so91048148wme.1 for ; Mon, 15 Feb 2016 23:16:09 -0800 (PST) In-Reply-To: <1455606865-22680-1-git-send-email-thomas.monjalon@6wind.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When built in a C++ application, the include fails for 2 reasons: rte_mbuf_offload.h:128:24: error: invalid conversion from =E2=80=98void*=E2=80=99 to =E2=80=98rte_pktmbuf_o= ffload_pool_private*=E2=80=99 [-fpermissive] rte_mempool_get_priv(mpool); ^ The cast must be explicit for C++. rte_mbuf_offload.h:304:1: error: expected declaration before =E2=80=98}=E2= =80=99 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(-) v2: - add struct keyword diff --git a/lib/librte_mbuf_offload/rte_mbuf_offload.h b/lib/librte_mbuf= _offload/rte_mbuf_offload.h index 4345f06..77993b6 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 =20 +#ifdef __cplusplus +extern "C" { +#endif =20 /** 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 =3D - rte_mempool_get_priv(mpool); + (struct rte_pktmbuf_offload_pool_private *)rte_mempool_get_priv(mpool)= ; =20 return priv->offload_priv_size; } --=20 2.7.0