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 8CD0DA0524; Fri, 27 Nov 2020 12:09:27 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D2CB5C938; Fri, 27 Nov 2020 12:09:24 +0100 (CET) Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by dpdk.org (Postfix) with ESMTP id F0076C930 for ; Fri, 27 Nov 2020 12:09:21 +0100 (CET) Received: by mail-wm1-f68.google.com with SMTP id f190so3141686wme.1 for ; Fri, 27 Nov 2020 03:09:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mayadata-io.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1HTB9zjrYBad6yFMyifFi7ZaM2G2d9zrbHyBap+7eUk=; b=xNOjAzxKaSXU/ZH6JkD01eZeCqonhS3aLCM8X6raeHM0vYA3k71v29o75kcI8zxVE6 rHKpdxma8+8ZSZtJgaR1tL1TG0flmHHcwCtyBjgnQ9DdNpgPaumX8ZcOVZzlIpLpdBrX aly+ATPzIR6vfVEKPaPfuLabLp/GJDq4HQwLBjIdh2L+4j/d8z+kjDfERxuLYDcwEYFp l9/JxwC73gFFJepGFMignBBL9rU95UnvbRBrq8MHPItBkfKv8H6QNYZ7xYxrlJxR0Tdw jWXduujeeDQXzvdensmvy1GpxZIsV6AAGIwntLdAx/sRrhSQfo6A80v5vnfI+SO/YIYr TPpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1HTB9zjrYBad6yFMyifFi7ZaM2G2d9zrbHyBap+7eUk=; b=EvWaI470rKjxru/KfTtTQAnkRaAb436Dg5qN9KrAZMoMVXCN72WcOYv+h+B2tRNIe6 uxqpbKM2BSAJSKrFVZvOYEvAnHWDTp6FqKTBbD5o8KI/iP+wMe+UHL6aFu9vboSa3mC7 zIilbGSjTDz8MAapI7igKqSOlMn3SyIgZFjG+UkViok6dxHGCp0N4I6qA0vwKE8DRgTQ plHy+Wjj+YNIv/aA5roA1WQKjFGDbgxJ/p0tdn/oMRO/qjJeymaXz9XIaQyaonrl4/oF LpMH79Ti1lO+d3puURwPRxCqxOocOC5WSETHDvSOR2Rq5IcivFKv4uNZtGnePuEt1V56 5tnQ== X-Gm-Message-State: AOAM533H5nypd6kwE3BC0jOXB0FGIB/g907LukqTYxRJdTlBMxrNiVnD lZzemusqjcobztc0anJ5C5nFrQ== X-Google-Smtp-Source: ABdhPJxCxT2PpRaLh7s3+l59E+Ygh5SosuVu5k3YgdFx4lJdN1c+mburcr+GZuX3NZu/nnVKIdk6Kg== X-Received: by 2002:a1c:a9c4:: with SMTP id s187mr8444938wme.180.1606475361611; Fri, 27 Nov 2020 03:09:21 -0800 (PST) Received: from FENIX.localdomain (cpc98320-croy25-2-0-cust77.19-2.cable.virginm.net. [80.235.134.78]) by smtp.gmail.com with ESMTPSA id n4sm13041664wmc.30.2020.11.27.03.09.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Nov 2020 03:09:20 -0800 (PST) From: Nick Connolly To: Dmitry Kozlyuk , Narcisa Ana Maria Vasile , Dmitry Malloy , Pallavi Kadam , Keith Wiles , Bruce Richardson , Ranjit Menon Cc: dev@dpdk.org, David Marchand , Nick Connolly , stable@dpdk.org Date: Fri, 27 Nov 2020 11:07:26 +0000 Message-Id: <20201127110726.5328-1-nick.connolly@mayadata.io> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] windows: build error with mingw debug 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" Compiling with MinGW in --buildtype=debug produces a redefinition error for strncasecmp. The root cause is that rte_os.h shouldn't be injecting POSIX definitions into the environment. It is the applications responsibility to decide how to handle missing functionality. Resolving this properly will require further work, but in the meantime wrap all such definitions with #ifndef/#endif. This resolves the specific issue with strncasecmp and handles similar issues that applications may encounter. Fixes: e8428a9d89f1 ("eal/windows: add some basic functions and macros") Cc: stable@dpdk.org Signed-off-by: Nick Connolly --- lib/librte_eal/windows/include/rte_os.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/lib/librte_eal/windows/include/rte_os.h b/lib/librte_eal/windows/include/rte_os.h index 569ed92d5..ea3fe60e5 100644 --- a/lib/librte_eal/windows/include/rte_os.h +++ b/lib/librte_eal/windows/include/rte_os.h @@ -25,22 +25,42 @@ extern "C" { #define PATH_MAX _MAX_PATH #endif +#ifndef sleep #define sleep(x) Sleep(1000 * (x)) +#endif +#ifndef strerror_r #define strerror_r(a, b, c) strerror_s(b, c, a) +#endif +#ifndef strdup /* strdup is deprecated in Microsoft libc and _strdup is preferred */ #define strdup(str) _strdup(str) +#endif +#ifndef strtok_r #define strtok_r(str, delim, saveptr) strtok_s(str, delim, saveptr) +#endif +#ifndef index #define index(a, b) strchr(a, b) +#endif + +#ifndef rindex #define rindex(a, b) strrchr(a, b) +#endif +#ifndef strncasecmp #define strncasecmp(s1, s2, count) _strnicmp(s1, s2, count) +#endif +#ifndef close #define close _close +#endif + +#ifndef unlink #define unlink _unlink +#endif /* cpu_set macros implementation */ #define RTE_CPU_AND(dst, src1, src2) CPU_AND(dst, src1, src2) @@ -89,7 +109,9 @@ eal_strerror(int code) return buffer; } +#ifndef strerror #define strerror eal_strerror +#endif #endif /* RTE_TOOLCHAIN_GCC */ -- 2.25.1