From patchwork Wed Nov 22 16:32:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 134532 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 87B8043382; Wed, 22 Nov 2023 17:32:41 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 02BC24028C; Wed, 22 Nov 2023 17:32:41 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id DDA0940265; Wed, 22 Nov 2023 17:32:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700670760; x=1732206760; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=D+LqBm3sqpHBotmiz6gTYbmxbDfp+acEa7LSdSHpn4g=; b=R+Z1n9ZM3vxLge9npKKxJ9JR8Dkwc2mOFLXX264MSY6kSR9jnLGfoMzo iXarr4/iCqqcR9yFGwoD1x4lcWsHrAD5A8rhWL/AElhESr2TcrNusNfG5 QgnjlIiHCN4DuuXRb9aZsUfv7kji9+SmoGo5t82OEWn+mcXbfi+rNH5zU cFeqgpwq0cL6u2IdD7+Tcv4l/WmN9VdE6hJKs+SHjcVazI/vn9fQBWqtT XU7bTl1SreDKhqkV/miKcktrl5fxlf0AqtCPVpt480iXsLqCwkqFPDqj4 d5ktEe1BORa1w7YIH4GhLbKdE5LXljTi7tH3ZDgdV3fsrWYpUn9zJU8gD A==; X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="391861819" X-IronPort-AV: E=Sophos;i="6.04,219,1695711600"; d="scan'208";a="391861819" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2023 08:32:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,219,1695711600"; d="scan'208";a="15317975" Received: from silpixa00401385.ir.intel.com ([10.237.214.22]) by fmviesa001.fm.intel.com with ESMTP; 22 Nov 2023 08:32:37 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Tyler Retzlaff , Bruce Richardson , dmitry.kozliuk@gmail.com, stable@dpdk.org, Narcisa Ana Maria Vasile , Dmitry Malloy , Pallavi Kadam Subject: [PATCH] eal/windows: fix mingw build Date: Wed, 22 Nov 2023 16:32:28 +0000 Message-Id: <20231122163228.986037-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 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 When compiling with mingw on Ubuntu 23.10, I get the following compiler error: ../../lib/eal/windows/eal_memory.c:77: error: "MEM_REPLACE_PLACEHOLDER" redefined [-Werror] 77 | #define MEM_REPLACE_PLACEHOLDER 0x00004000 | In file included from /usr/share/mingw-w64/include/minwindef.h:163, from /usr/share/mingw-w64/include/windef.h:9, from /usr/share/mingw-w64/include/windows.h:69, from ../../lib/eal/windows/include/rte_windows.h:32, from ../../lib/eal/windows/include/rte_os_shim.h:9, from ../../lib/eal/common/eal_internal_cfg.h:14, from ../../lib/eal/windows/eal_memory.c:11: /usr/share/mingw-w64/include/winnt.h:5710: note: this is the location of the previous definition 5710 | #define MEM_REPLACE_PLACEHOLDER 0x4000 and a similar error for MEM_RESERVE_PLACEHOLDER. These errors can be fixed by wrapping the two defines in #ifndef .. #endif blocks. Fixes: 2a5d547a4a9b ("eal/windows: implement basic memory management") Cc: dmitry.kozliuk@gmail.com Cc: stable@dpdk.org Signed-off-by: Bruce Richardson --- lib/eal/windows/eal_memory.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/eal/windows/eal_memory.c b/lib/eal/windows/eal_memory.c index 215d768e2c..64598745de 100644 --- a/lib/eal/windows/eal_memory.c +++ b/lib/eal/windows/eal_memory.c @@ -74,8 +74,13 @@ static VirtualAlloc2_type VirtualAlloc2_ptr; #define MEM_COALESCE_PLACEHOLDERS 0x00000001 #define MEM_PRESERVE_PLACEHOLDER 0x00000002 + +#ifndef MEM_REPLACE_PLACEHOLDER #define MEM_REPLACE_PLACEHOLDER 0x00004000 +#endif +#ifndef MEM_RESERVE_PLACEHOLDER #define MEM_RESERVE_PLACEHOLDER 0x00040000 +#endif int eal_mem_win32api_init(void)