From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 6DEC83975 for ; Thu, 28 Aug 2014 05:36:18 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 27 Aug 2014 20:40:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,415,1406617200"; d="scan'208";a="564530767" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga001.jf.intel.com with ESMTP; 27 Aug 2014 20:39:56 -0700 Received: from fmsmsx119.amr.corp.intel.com (10.19.9.28) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 27 Aug 2014 20:39:56 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX119.amr.corp.intel.com (10.19.9.28) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 27 Aug 2014 20:39:56 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.17]) by shsmsx102.ccr.corp.intel.com ([169.254.2.246]) with mapi id 14.03.0195.001; Thu, 28 Aug 2014 11:39:54 +0800 From: "Wu, Jingjing" To: Thomas Monjalon Thread-Topic: [dpdk-dev] [PATCH v2 5/7] fix the Marco conflict Thread-Index: AQHPwZy6uM+I2qgzZkecQsE4GrHl+Zvj/M+AgAFhCNA= Date: Thu, 28 Aug 2014 03:39:53 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F8ADBF1D@SHSMSX104.ccr.corp.intel.com> References: <1409105634-29980-1-git-send-email-jingjing.wu@intel.com> <1409105634-29980-6-git-send-email-jingjing.wu@intel.com> <9091956.EmWA3cIqCF@xps13> In-Reply-To: <9091956.EmWA3cIqCF@xps13> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v2 5/7] fix the Marco conflict 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: , X-List-Received-Date: Thu, 28 Aug 2014 03:36:19 -0000 Hi, Thomas Because these macros such as IPPROTO_TCP, IPPROTO_UDP are already defined i= n . If user's application include and rte_ip.h= at the same time, there will be conflict error, for example cmdline.c in t= estpmd. I remember there was someone also raised this issue few month ago. So just use the way "#ifndef #endif" to avoid the conflict. And it is exact= ly workaround as you said. Oh, it should be macro, but not marco, my spelling mistake. Sorry for that. I will rename this. > -----Original Message----- > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > Sent: Wednesday, August 27, 2014 10:28 PM > To: Wu, Jingjing > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v2 5/7] fix the Marco conflict >=20 > 2014-08-27 10:13, Jingjing Wu: > > fix the Marco conflict between rte_ip.h and netinet/in.h >=20 > Who is Marco? >=20 > > +#ifndef _NETINET_IN_H > > +#ifndef _NETINET_IN_H_ > > /* IPv4 protocols */ > > #define IPPROTO_IP 0 /**< dummy for IP */ > > #define IPPROTO_HOPOPTS 0 /**< IP6 hop-by-hop options */ > > @@ -226,7 +228,8 @@ struct ipv4_hdr { > > #define IPPROTO_DIVERT 254 /**< divert pseudo-protocol */ > > #define IPPROTO_RAW 255 /**< raw IP packet */ > > #define IPPROTO_MAX 256 /**< maximum protocol number */ > > - > > +#endif /* _NETINET_IN_H_ */ > > +#endif /* _NETINET_IN_H */ >=20 > Please explain your "fix" (which seems to be a workaround). >=20 > -- > Thomas