[v3,1/3] net: fix s_addr redefinition in Windows
Checks
Commit Message
s_addr in Windows is defined in 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(+)
Comments
Hi,
On Wed, Jul 08, 2020 at 11:25:23AM +0300, Fady Bader wrote:
> s_addr in Windows is defined in windows.h so its
Is it windows.h, or is it winsock.h or winsock2.h instead?
> 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(+)
>
> diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h
> index 0ae4e75b6c..f6e37d9e5e 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 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. */
> --
> 2.16.1.windows.4
>
> -----Original Message-----
> From: Olivier Matz <olivier.matz@6wind.com>
> Sent: Monday, July 13, 2020 5:39 PM
> To: Fady Bader <fady@mellanox.com>
> Cc: dev@dpdk.org; Thomas Monjalon <thomas@monjalon.net>; Tasnim Bashar
> <tbashar@mellanox.com>; Tal Shnaiderman <talshn@mellanox.com>; Yohad Tor
> <yohadt@mellanox.com>; dmitry.kozliuk@gmail.com;
> harini.ramakrishnan@microsoft.com; ocardona@microsoft.com;
> pallavi.kadam@intel.com; ranjit.menon@intel.com
> Subject: Re: [PATCH v3 1/3] net: fix s_addr redefinition in Windows
>
> Hi,
>
> On Wed, Jul 08, 2020 at 11:25:23AM +0300, Fady Bader wrote:
> > s_addr in Windows is defined in windows.h so its
>
> Is it windows.h, or is it winsock.h or winsock2.h instead?
S_addr is defined in winsock2.h which is included by windows.h.
>
> > 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(+)
> >
> > diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h
> > index 0ae4e75b6c..f6e37d9e5e 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 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. */
> > --
> > 2.16.1.windows.4
> >
@@ -23,6 +23,15 @@ extern "C" {
#include <rte_mbuf.h>
#include <rte_byteorder.h>
+/*
+ * s_addr in windows is defined in 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. */