[v4,1/3] net: fix s_addr redefinition in Windows
diff mbox series

Message ID 20200723070825.6448-2-fady@mellanox.com
State Accepted
Delegated to: Thomas Monjalon
Headers show
Series
  • compile librte_net for windows
Related show

Checks

Context Check Description
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Fady Bader July 23, 2020, 7:08 a.m. UTC
s_addr in Windows is defined in defined winsock2.h which is included by
windows.h so its undefined in order to be defined as part of
rte_ether_hdr.

Signed-off-by: Fady Bader <fady@mellanox.com>
---
 lib/librte_net/rte_ether.h | 9 +++++++++
 1 file changed, 9 insertions(+)

Patch
diff mbox series

diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h
index a358e88763..6690690b13 100644
--- a/lib/librte_net/rte_ether.h
+++ b/lib/librte_net/rte_ether.h
@@ -23,6 +23,15 @@  extern "C" {
 #include <rte_mbuf.h>
 #include <rte_byteorder.h>
 
+/*
+ * s_addr in windows is defined in winsock2.h which is included by windows.h
+ * it is undefined here to be defined as part of rte_ether_hdr
+ */
+#ifdef RTE_EXEC_ENV_WINDOWS
+#undef s_addr
+#endif
+
+
 #define RTE_ETHER_ADDR_LEN  6 /**< Length of Ethernet address. */
 #define RTE_ETHER_TYPE_LEN  2 /**< Length of Ethernet type field. */
 #define RTE_ETHER_CRC_LEN   4 /**< Length of Ethernet CRC. */