[2/3] net: add htons to minGW for Windows
Checks
Commit Message
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(+)
@@ -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)
@@ -2,7 +2,9 @@
* Copyright(c) 2018 Intel Corporation
*/
+#ifndef RTE_EXEC_ENV_WINDOWS
#include <arpa/inet.h>
+#endif
#include <rte_arp.h>