From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 45D264332D; Tue, 14 Nov 2023 18:46:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C7E1E4028A; Tue, 14 Nov 2023 18:46:39 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 512224027B; Tue, 14 Nov 2023 18:46:38 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 925F620B74C1; Tue, 14 Nov 2023 09:46:37 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 925F620B74C1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1699983997; bh=IEt8//aCXohebhhqo6io+5IiCi23yTsj0RyNzEUd3po=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VUr6r/PUv2gFevDNwyYsVqi4QD96aOgPKYqLzMmAtdtq7Ym+0YBUYx+59EjuI2yOa u6It+vfrIEX8dLGeOZOsNhE1HzAzpGQ8QQnXSyAP4IYqBpDeoIdJnQ4ul8t436cpZl IHsp/5QxVMxa2724D7hTM4KnmH6oWGmSa2xo3U7Y= Date: Tue, 14 Nov 2023 09:46:37 -0800 From: Tyler Retzlaff To: Gregory Etelson Cc: dev@dpdk.org, mkashani@nvidia.com, thomas@monjalon.net, stable@dpdk.org, Dmitry Kozlyuk , Narcisa Ana Maria Vasile , Dmitry Malloy , Pallavi Kadam Subject: Re: [PATCH] eal/windows: fix memory management macros usage Message-ID: <20231114174637.GC23774@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20231114170529.176665-1-getelson@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231114170529.176665-1-getelson@nvidia.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Tue, Nov 14, 2023 at 07:05:29PM +0200, Gregory Etelson wrote: > Windows compilation with cross-mingw on Fedora 39 failed > because MEM_REPLACE_PLACEHOLDER and MEM_RESERVE_PLACEHOLDER were > already defined in the compiler environment: > > eal_memory.c:77: error: "MEM_REPLACE_PLACEHOLDER" redefined > /usr/x86_64-w64-mingw32/sys-root/mingw/include/winnt.h:5710: note: > this is the location of the previous definition > > eal_memory.c:78: error: "MEM_RESERVE_PLACEHOLDER" redefined > /usr/x86_64-w64-mingw32/sys-root/mingw/include/winnt.h:5715: note: > this is the location of the previous definition > > The patch masks MEM_REPLACE_PLACEHOLDER and MEM_RESERVE_PLACEHOLDER > macros if they were pre-defined by compiler. > > The patch also masks MEM_COALESCE_PLACEHOLDERS and > MEM_PRESERVE_PLACEHOLDER to prevent similar errors. > > Fixes: 2a5d547a4a9b ("eal/windows: implement basic memory management") > > Cc: stable@dpdk.org > Signed-off-by: Gregory Etelson > --- since we are duplicating something that comes from something else that has been duplicated out of windows WDK here it might be a reasonable safety check to verify that our duplicated values match our expectations? #ifndef MEM_COALESCE_PLACEHOLDERS #define MEM_COALESCE_PLACEHOLDERS 0x00000001 #else static_assert(MEM_COALESCE_PLACEHOLDERS == 0x00000001, "...") #endif either way, this is straight forward. Acked-by: Tyler Retzlaff