From patchwork Fri Mar 6 15:59:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ananyev, Konstantin" X-Patchwork-Id: 3914 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 4A40011C5; Fri, 6 Mar 2015 17:00:15 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id D13BB11A2 for ; Fri, 6 Mar 2015 17:00:13 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 06 Mar 2015 07:54:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,353,1422950400"; d="scan'208";a="661490744" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga001.jf.intel.com with ESMTP; 06 Mar 2015 08:00:04 -0800 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t26G048s023118; Fri, 6 Mar 2015 16:00:04 GMT Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id t26G03oY023731; Fri, 6 Mar 2015 16:00:03 GMT Received: (from kananye1@localhost) by sivswdev02.ir.intel.com with id t26G032K023727; Fri, 6 Mar 2015 16:00:03 GMT From: Konstantin Ananyev To: dev@dpdk.org Date: Fri, 6 Mar 2015 15:59:47 +0000 Message-Id: <1425657587-23516-1-git-send-email-konstantin.ananyev@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <20150225142851.55406347@miho> References: <20150225142851.55406347@miho> In-Reply-To: <20150225142851.55406347@miho> References: <20150225142851.55406347@miho> Subject: [dpdk-dev] [PATCHv2] headers: typeof -> __typeof__ to unbreak C++11 code X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list 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" v2: Instead of changing all the affected files, define 'typeofi' and 'asm' if needed. When compiling C++11-code or above (--std=c++11), the build fails with lots of rte_eth_ctrl.h:517:3: note: in expansion of macro RTE_ALIGN (RTE_ALIGN(RTE_ETH_FLOW_MAX, UINT32_BIT)/UINT32_BIT) ^ When reading the GCC info pages, I get the feeling that __typeof__ is a better choice, and that indeed works when including the headers in C++ files (--std=c++11). There are some typeof()s left in C files, the patch only touches the public API. Signed-off-by: Simon Kagstrom Signed-off-by: Konstantin Ananyev --- lib/librte_eal/common/include/rte_common.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h index 8ac940c..1867692 100644 --- a/lib/librte_eal/common/include/rte_common.h +++ b/lib/librte_eal/common/include/rte_common.h @@ -51,6 +51,15 @@ extern "C" { #include #include +#ifndef typeof +#define typeof __typeof__ +#endif + +#ifndef asm +#define asm __asm__ +#endif + + /*********** Macros to eliminate unused variable warnings ********/ /**