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 AF65AA04FA; Thu, 6 Feb 2020 11:59:11 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C7686AAD5; Thu, 6 Feb 2020 11:59:10 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 0EC00A69 for ; Thu, 6 Feb 2020 11:59:08 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Feb 2020 02:59:07 -0800 X-IronPort-AV: E=Sophos;i="5.70,409,1574150400"; d="scan'208";a="224971122" Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.79]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 06 Feb 2020 02:59:05 -0800 Date: Thu, 6 Feb 2020 10:59:02 +0000 From: Bruce Richardson To: Dmitry Kozlyuk Cc: Thomas Monjalon , dev@dpdk.org, harini.ramakrishnan@microsoft.com Message-ID: <20200206105902.GA767@bricha3-MOBL.ger.corp.intel.com> References: <20200131030744.19596-1-dmitry.kozliuk@gmail.com> <2199644.NG923GbCHz@xps> <20200205022138.68c6b854@Sovereign> <12853507.RDIVbhacDa@xps> <20200205143050.GB687@bricha3-MOBL.ger.corp.intel.com> <20200205234105.61ad5c55@Sovereign> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200205234105.61ad5c55@Sovereign> User-Agent: Mutt/1.12.1 (2019-06-15) Subject: Re: [dpdk-dev] [PATCH 4/6] build: MinGW-w64 support for Meson 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" On Wed, Feb 05, 2020 at 11:41:05PM +0300, Dmitry Kozlyuk wrote: > > > > > > +if is_windows > > > > > > + # Require platform SDK for Windows 7 and above. > > > > > > + add_project_arguments('-D_WIN32_WINNT=0x0601', language: 'c') > > > > > > > > > > Please explain. Why Windows 7 is needed? What this define is doing? > > > > > > > > Yes, Windows 7 and above is need for already existing code in eal_lcore.c, > > > > specifically for GetLogicalProcessorInformation() call. > > > > > > > > When including , one must define minimum API version the > > > > application is compiled against [0]. MSVC and Clang default to the version of > > > > platform SDK (that is, maximum supported). MinGW defaults to Windows XP, so > > > > this definition must be either in before #include or > > > > here. Because other files may include , I'd prefer to have a > > > > global definition via compiler command-line. > > > > > > > > [0]: > > > > https://docs.microsoft.com/en-us/windows/win32/WinProg/using-the-windows-headers > > > > > > OK, thanks. > > > Please reword the comment with something like > > > "Minimum supported API is Windows 7." > > > > > For this, as an alternative to putting it as a project argument, you can just > > add it to dpdk_conf which means it will end up as a define in the global > > rte_build_config.h and so be directly included in each compilation unit > > ahead of any other headers. (rte_config.h includes rte_build_config.h) > > Can you please explain why using dpdk_conf is a better alternative? In > lib/meson.build I can see add_project_arguments('_D_GNU_SOURCE', ...), which > serves a similar purpose on POSIX systems. Compiler option also makes it > impossible to forget or redefine this constant in code by mistake. > I'm not necessarily saying it's better, it's just an alternative to consider. :-) Having it in rte_config.h makes the define available to any external apps using DPDK, which may or may not be desirable.