dev.dpdk.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] llib/ibrte_net: workaround to avoid macro conflict
@ 2014-09-30  2:49 Jingjing Wu
       [not found] ` <1412045348-18543-1-git-send-email-jingjing.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Jingjing Wu @ 2014-09-30  2:49 UTC (permalink / raw)
  To: dev-VfR2kkLFssw

Macros such as IPPROTO_TCP, IPPROTO_UDP are already defined in <netinet/in.h>.
If user's application includes <netinet/in.h> 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 <jingjing.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-11-27 18:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-30  2:49 [PATCH] llib/ibrte_net: workaround to avoid macro conflict Jingjing Wu
     [not found] ` <1412045348-18543-1-git-send-email-jingjing.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-09-30  5:07   ` Thomas Monjalon
2014-10-09  5:17     ` Wu, Jingjing
2014-09-30 13:09   ` Neil Horman
     [not found]     ` <20140930130950.GF2193-B26myB8xz7F8NnZeBjwnZQMhkBWG/bsMQH7oEaQurus@public.gmane.org>
2014-10-09  5:20       ` Wu, Jingjing
     [not found]         ` <9BB6961774997848B5B42BEC655768F8B04B34-0J0gbvR4kTg/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-10-09  5:37           ` Matthew Hall
2014-10-09 11:29           ` Neil Horman
     [not found]             ` <20141009112918.GA20940-B26myB8xz7F8NnZeBjwnZQMhkBWG/bsMQH7oEaQurus@public.gmane.org>
2014-11-03  7:41               ` Thomas Monjalon
2014-11-17 14:17                 ` Neil Horman
     [not found]                   ` <20141117141708.GE17886-B26myB8xz7F8NnZeBjwnZQMhkBWG/bsMQH7oEaQurus@public.gmane.org>
2014-11-27 11:48                     ` [PATCH] net: fix conflict with libc Thomas Monjalon
     [not found]                       ` <1417088895-15568-1-git-send-email-thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-27 14:03                         ` Ivan Boule
     [not found]                           ` <54772F35.302-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-11-27 18:13                             ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).