From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 090F3A051B; Wed, 10 Jun 2020 14:01:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5AB681BF4F; Wed, 10 Jun 2020 14:01:23 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 885DC1BEDD for ; Wed, 10 Jun 2020 14:01:20 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from fady@mellanox.com) with SMTP; 10 Jun 2020 15:00:46 +0300 Received: from l-wincomp04-vm.labs.mlnx (l-wincomp04-vm.mtl.labs.mlnx [10.237.1.5]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 05AC0iZE006240; Wed, 10 Jun 2020 15:00:45 +0300 From: Fady Bader To: dev@dpdk.org Cc: fady@mellanox.com, thomas@monjalon.net, 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 Date: Wed, 10 Jun 2020 15:00:39 +0300 Message-Id: <20200610120040.17968-3-fady@mellanox.com> X-Mailer: git-send-email 2.16.1.windows.4 In-Reply-To: <20200610120040.17968-1-fady@mellanox.com> References: <'20200610112326.18576-1-fady@mellanox.com'> <20200610120040.17968-1-fady@mellanox.com> Subject: [dpdk-dev] [PATCH v2 2/3] net: add htons to minGW for Windows X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" htons wasnt defined in Windows for the minGW compiler. Definition of htons was added in order to use htons. Signed-off-by: Fady Bader --- 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 +#endif #include -- 2.16.1.windows.4