From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jingjing Wu Subject: [PATCH] llib/ibrte_net: workaround to avoid macro conflict Date: Tue, 30 Sep 2014 10:49:08 +0800 Message-ID: <1412045348-18543-1-git-send-email-jingjing.wu@intel.com> To: dev-VfR2kkLFssw@public.gmane.org Return-path: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 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