From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 373DC5902 for ; Tue, 30 Sep 2014 04:42:38 +0200 (CEST) Received: from azsmga001.ch.intel.com ([10.2.17.19]) by orsmga103.jf.intel.com with ESMTP; 29 Sep 2014 19:47:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,624,1406617200"; d="scan'208";a="480884494" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by azsmga001.ch.intel.com with ESMTP; 29 Sep 2014 19:49:14 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id s8U2nBK2001228; Tue, 30 Sep 2014 10:49:12 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id s8U2n97r018578; Tue, 30 Sep 2014 10:49:11 +0800 Received: (from wujingji@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s8U2n9UK018574; Tue, 30 Sep 2014 10:49:09 +0800 From: Jingjing Wu To: dev@dpdk.org Date: Tue, 30 Sep 2014 10:49:08 +0800 Message-Id: <1412045348-18543-1-git-send-email-jingjing.wu@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] llib/ibrte_net: workaround to avoid macro 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: Tue, 30 Sep 2014 02:42:39 -0000 Macros such as IPPROTO_TCP, IPPROTO_UDP are already defined in . If user's application includes and rte_ip.h at the same time, there will be conflict error. This patch uses the way "#ifndef #endif" to avoid the conflict. Signed-off-by: Jingjing Wu --- lib/librte_net/rte_ip.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h index e3f65c1..2bcb479 100644 --- a/lib/librte_net/rte_ip.h +++ b/lib/librte_net/rte_ip.h @@ -116,6 +116,8 @@ struct ipv4_hdr { #define IPV4_HDR_OFFSET_UNITS 8 +#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 */ @@ -227,6 +229,9 @@ struct ipv4_hdr { #define IPPROTO_RAW 255 /**< raw IP packet */ #define IPPROTO_MAX 256 /**< maximum protocol number */ +#endif /*_NETINET_IN_H_*/ +#endif /*_NETINET_IN_H*/ + /* * IPv4 address types */ -- 1.8.1.4