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 1238EA056A; Thu, 11 Mar 2021 18:08:12 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E466D406A3; Thu, 11 Mar 2021 18:08:11 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id EB0464014D for ; Thu, 11 Mar 2021 18:08:09 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 43900208D369; Thu, 11 Mar 2021 09:08:09 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 43900208D369 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1615482489; bh=tZ/0ClNycvdeAwZxMJNSbUctI9FBxUuHrLEIxPfRjl8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cR40GyEYNqqipNbcqCM4wYII2IAGlyUwjrjurtxjFuVqRddLIw35nV2hmuW2txg8v T4I7MK2Ll5qJs5O2U/XtpwF8k7QmoVmi0cXM2KoKCKZV2NFIM7G3l1sUog3u6XemmU 8tK/nmA0wK9fyU4uZgfTp6EDTbb7vjkRUPZhAGrQ= Date: Thu, 11 Mar 2021 09:08:09 -0800 From: Tyler Retzlaff To: Dmitry Kozlyuk Cc: John Alexander , "dev@dpdk.org" , Ferruh Yigit , Pallavi Kadam , Dmitry Malloy , Narcisa Ana Maria Vasile , Stephen Hemminger , Declan Doherty , Fiona Trahe , Ashish Gupta , Ray Kinsella , Neil Horman Message-ID: <20210311170809.GA31775@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20210303225121.16146-1-dmitry.kozliuk@gmail.com> <20210310235421.23259-1-dmitry.kozliuk@gmail.com> <20210311200101.2031f1e0@sovereign> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210311200101.2031f1e0@sovereign> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [dpdk-dev] [PATCH v2] doc: announce API changes for Windows compatibility 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 Sender: "dev" On Thu, Mar 11, 2021 at 08:01:01PM +0300, Dmitry Kozlyuk wrote: > 2021-03-11 16:19 (UTC+0000), John Alexander: > [...] > > > * `struct rte_param_log2_range`, `struct rte_crypto_param_range`: > > > > > > * `min` -> `minimum` > > > * `max` -> `maximum` > > > > > > The min/max macros in the Windows headers cause issues with C++ projects also (breaks std::min/std::max). The fix there is to "#define NOMINMAX" prior to including windows.h, maybe that's appropriate here too? > > We don't control include order in user code and we shouldn't #undef system > macros in public headers. We could push_macro/pop_macro around structure > definition and have min/max undefined in DPDK internal code, so that including > this header always works. Then, if user wants to access the fields, they > should take care of macros themselves. agreed, nothing stops an application from including windows.h before dpdk includes windows.h and similarly the application shouldn't have visibility of min/max (broken as they are) disappear from the application namespace after including dpdk headers. the approach of altering what appears in the namespace for the scope of the dpdk header preprocessing is about the best that can be achieved.