From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] mbuf: fix compile by making sched struct visible Date: Thu, 10 Jan 2019 18:34:58 +0100 Message-ID: <1558979.Xtpf54c0cE@xps> References: <20190110165051.4859-1-harry.van.haaren@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, reshma.pattan@intel.com, cristian.dumitrescu@intel.com, olivier.matz@6wind.com To: Harry van Haaren Return-path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 0D5B71B729 for ; Thu, 10 Jan 2019 18:35:02 +0100 (CET) In-Reply-To: <20190110165051.4859-1-harry.van.haaren@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 10/01/2019 17:50, Harry van Haaren: > Although C compilation works with the struct rte_mbuf_sched > declared inside the struct rte_mbuf namespace, C++ fails to > compile. This fix moves the rte_mbuf_sched struct up to the > global namespace, instead of declaring it inside the struct > mbuf namespace. > > The struct rte_mbuf_sched is being used on the stack in > rte_mbuf_sched_get() and as a cast in _set(). For this > reason, it must be exposed as an available type. > > Fixes: 5d3f72100904 ("mbuf: implement generic format for sched field") > > Signed-off-by: Harry van Haaren > > --- > > Cc: reshma.pattan@intel.com > Cc: cristian.dumitrescu@intel.com > Cc: thomas@monjalon.net > > Hey folks, > > Currently the mbuf header will fail to compile with a C++ compiler, > this patch is one possible solution. I'm not particularly happy with > this as a fix as it reduces mbuf struct readability, however it does > resolve the issue. What are the other possible solutions?