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 BD22BA0527 for ; 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 8FD55C958; Fri, 27 Nov 2020 12:09:26 +0100 (CET) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by dpdk.org (Postfix) with ESMTP id F2CA2C938 for ; Fri, 27 Nov 2020 12:09:22 +0100 (CET) Received: by mail-wm1-f67.google.com with SMTP id f190so3141687wme.1 for ; Fri, 27 Nov 2020 03:09:22 -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=gzEBNkZ8rTNqVii634koO0YCIhH4+Q7dvbJOoYbTevXS16mfiXnPYfu+argN8jYCoD eBtprvN3NHsy0AQl9fxLABtyBJlYJxIeiAwvKqesczDV1+wh0RL0EQzJHda91hri1FMi 94ywNByGtsplGI0ORVj7EPOIssXnjgq/qKm3xZoSbZRP3hCQS7XW/LPtdfCovYhvGffZ bvDc2v5YhWcmklGA1kN+Sua+EGwy1PRmR8ZVwBCJn87ie1hOtutT/BfH2IFZOX/ZZ+nn Za2hZ+vD6sM+d0tuAzXQ+CVRvPVisM72ll0PilwnimiYMV1tX5uRcOIacNOzwKRlfjI4 Ga5A== X-Gm-Message-State: AOAM5308YOetLT8B8ijdMEblO0EcdITNOfHDHFSWdWoBxkhjxL5SNrY9 rD8LW+Z1YxeDRg+y9VVCo+3sWw== 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-stable] [PATCH] windows: build error with mingw debug X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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