From 507e1ca07bee3c78c4da1262c4c00668d7a1f8ec Mon Sep 17 00:00:00 2001 From: Fady Bader Date: Thu, 23 Jul 2020 10:08:23 +0300 Subject: [PATCH] net: fix redefinition in Windows In Windows, s_addr is defined in winsock2.h which is included by windows.h. It is undefined in order to be defined as part of rte_ether_hdr. Signed-off-by: Fady Bader Acked-by: Ranjit Menon Tested-by: Pallavi Kadam Signed-off-by: Thomas Monjalon --- lib/librte_net/rte_ether.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h index a358e88763..a9c6925f8d 100644 --- a/lib/librte_net/rte_ether.h +++ b/lib/librte_net/rte_ether.h @@ -23,6 +23,10 @@ extern "C" { #include #include +#ifdef RTE_EXEC_ENV_WINDOWS /* Workaround conflict with rte_ether_hdr. */ +#undef s_addr /* Defined in winsock2.h included in windows.h. */ +#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. */