From: Fady Bader <fady@mellanox.com>
To: dev@dpdk.org
Cc: fady@mellanox.com, thomasm@mellanox.com, tbashar@mellanox.com,
talshn@mellanox.com, yohadt@mellanox.com,
dmitry.kozliuk@gmail.com, harini.ramakrishnan@microsoft.com,
ocardona@microsoft.com, anand.rawat@intel.com,
ranjit.menon@intel.com, olivier.matz@6wind.com
Subject: [dpdk-dev] [PATCH 2/3] net: add htons to minGW for Windows
Date: Wed, 10 Jun 2020 14:23:25 +0300 [thread overview]
Message-ID: <20200610112326.18576-3-fady@mellanox.com> (raw)
In-Reply-To: <20200610112326.18576-1-fady@mellanox.com>
htons wasnt defined in Windows for the minGW compiler.
Definition of htons was added in order to use htons.
Signed-off-by: Fady Bader <fady@mellanox.com>
---
lib/librte_eal/windows/include/rte_os.h | 4 ++++
lib/librte_net/rte_arp.c | 2 ++
2 files changed, 6 insertions(+)
diff --git a/lib/librte_eal/windows/include/rte_os.h b/lib/librte_eal/windows/include/rte_os.h
index bab011a5c..95525123f 100644
--- a/lib/librte_eal/windows/include/rte_os.h
+++ b/lib/librte_eal/windows/include/rte_os.h
@@ -28,6 +28,10 @@ extern "C" {
#define strerror_r(a, b, c) strerror_s(b, c, a)
+#ifdef RTE_TOOLCHAIN_GCC
+#define htons(x) (rte_cpu_to_be_16(x))
+#endif
+
/* strdup is deprecated in Microsoft libc and _strdup is preferred */
#define strdup(str) _strdup(str)
diff --git a/lib/librte_net/rte_arp.c b/lib/librte_net/rte_arp.c
index 784b7f48f..8fd431c54 100644
--- a/lib/librte_net/rte_arp.c
+++ b/lib/librte_net/rte_arp.c
@@ -2,7 +2,9 @@
* Copyright(c) 2018 Intel Corporation
*/
+#ifndef RTE_EXEC_ENV_WINDOWS
#include <arpa/inet.h>
+#endif
#include <rte_arp.h>
--
2.16.1.windows.4
next prev parent reply other threads:[~2020-06-10 11:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-10 11:23 [dpdk-dev] [PATCH 0/3] compile librte_net for windows Fady Bader
2020-06-10 11:23 ` [dpdk-dev] [PATCH 1/3] net: fix s_addr redefinition in Windows Fady Bader
2020-06-10 11:23 ` Fady Bader [this message]
2020-06-10 11:23 ` [dpdk-dev] [PATCH 3/3] eal/windows: librte_net build on Windows Fady Bader
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200610112326.18576-3-fady@mellanox.com \
--to=fady@mellanox.com \
--cc=anand.rawat@intel.com \
--cc=dev@dpdk.org \
--cc=dmitry.kozliuk@gmail.com \
--cc=harini.ramakrishnan@microsoft.com \
--cc=ocardona@microsoft.com \
--cc=olivier.matz@6wind.com \
--cc=ranjit.menon@intel.com \
--cc=talshn@mellanox.com \
--cc=tbashar@mellanox.com \
--cc=thomasm@mellanox.com \
--cc=yohadt@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).