From: Andre Muezerie <andremue@linux.microsoft.com>
To: Konstantin Ananyev <konstantin.ananyev@huawei.com>
Cc: Bruce Richardson <bruce.richardson@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>,
"david.marchand@redhat.com" <david.marchand@redhat.com>,
"thomas@monjalon.net" <thomas@monjalon.net>,
"stephen@networkplumber.org" <stephen@networkplumber.org>
Subject: Re: [PATCH v4 0/7] eliminate dependency on non-portable __SIZEOF_LONG__
Date: Wed, 5 Feb 2025 08:11:34 -0800 [thread overview]
Message-ID: <20250205161134.GA16706@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> (raw)
In-Reply-To: <795761cc11bf4084aa353ca77309b916@huawei.com>
On Wed, Feb 05, 2025 at 03:50:03PM +0000, Konstantin Ananyev wrote:
>
> > On Wed, Feb 05, 2025 at 07:37:21AM -0800, Andre Muezerie wrote:
> > > On Wed, Feb 05, 2025 at 09:15:43AM +0000, Bruce Richardson wrote:
> > > > On Tue, Feb 04, 2025 at 10:54:24AM -0800, Andre Muezerie wrote:
> > > > > Macro __SIZEOF_LONG__ is not standardized and MSVC does not define it.
> > > > > Therefore the errors below are seen with MSVC:
> > > > >
> > > > > ../lib/mldev/mldev_utils_scalar.c(465): error C2065:
> > > > > '__SIZEOF_LONG__': undeclared identifier
> > > > > ../lib/mldev/mldev_utils_scalar.c(478): error C2051:
> > > > > case expression not constant
> > > > >
> > > > > ../lib/mldev/mldev_utils_scalar_bfloat16.c(33): error C2065:
> > > > > '__SIZEOF_LONG__': undeclared identifier
> > > > > ../lib/mldev/mldev_utils_scalar_bfloat16.c(49): error C2051:
> > > > > case expression not constant
> > > > >
> > > > > Turns out that the places where __SIZEOF_LONG__ is currently
> > > > > being used can equally well use sizeof(long) instead.
> > > > >
> > > > > v4:
> > > > > * rebased on latest main as previous patch was not applying cleanly
> > > > > anymore.
> > > > >
> > > > > v3:
> > > > > * added prefix RTE_ to BITS_PER_LONG* and moved them to rte_common.h
> > > > > * defined PLT_BITS_PER_LONG* in drivers/common/cnxk/roc_platform.h to
> > > > > avoid warnings from checkpatches.sh like:
> > > > >
> > > > > Warning in drivers/common/cnxk/roc_bits.h:
> > > > > Warning in drivers/common/cnxk/roc_ie_ot.h:
> > > > > Warning in drivers/common/cnxk/roc_ie_ot_tls.h:
> > > > > Use plt_ symbols instead of rte_ API in cnxk base driver
> > > > >
> > > > > It can be seen that the same was done in the past for similar
> > > > > macros like PLT_CACHE_LINE_SIZE
> > > > >
> > > > > v2:
> > > > > * fixed typo in commit message
> > > > >
> > > > > Andre Muezerie (7):
> > > > > eal: eliminate dependency on non-portable __SIZEOF_LONG__
> > > > > drivers/bus: eliminate dependency on non-portable __SIZEOF_LONG__
> > > > > drivers/common: eliminate dependency on non-portable __SIZEOF_LONG__
> > > > > drivers/dma: eliminate dependency on non-portable __SIZEOF_LONG__
> > > > > drivers/net: eliminate dependency on non-portable __SIZEOF_LONG__
> > > > > drivers/raw: eliminate dependency on non-portable __SIZEOF_LONG__
> > > > > mldev: eliminate dependency on non-portable __SIZEOF_LONG__
> > > > >
> > > > Just out of interest, is there are reason why the simple solution of just
> > > > putting "#define __SIZEOF_LONG__ (sizeof(long))" in a header file for MSVC
> > > > is not done? Should be a couple of lines in a single patch, rather than a
> > > > 7-patch series, no?
> > > >
> > > > After all, just because something is non-standard, doesn't mean that we
> > > > can't use it if its widely available.
> > > >
> > > > /Bruce
> > >
> > > Yes, that can be done instead. I'll send out a new series with that approach.
> > >
> > Maybe wait in case there is input from others before spending time on a
> > patch? I think the simpler solution is better, but others may feel that
> > removing the macro completely is the better approach.
>
> +1 to what Bruce suggested.
>
Thomas also mentioned he would prefer to minimize changes. I'm fine with that too, as
that is good enough to get the code to compile with MSVC.
next prev parent reply other threads:[~2025-02-05 16:11 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-04 20:09 [PATCH 0/6] " Andre Muezerie
2024-12-04 20:09 ` [PATCH 1/6] drivers/bus: " Andre Muezerie
2024-12-04 21:41 ` [PATCH v2 0/6] " Andre Muezerie
2024-12-04 21:41 ` [PATCH v2 1/6] drivers/bus: " Andre Muezerie
2024-12-04 21:41 ` [PATCH v2 2/6] drivers/common: " Andre Muezerie
2024-12-04 21:41 ` [PATCH v2 3/6] drivers/dma: " Andre Muezerie
2024-12-04 21:41 ` [PATCH v2 4/6] drivers/net: " Andre Muezerie
2024-12-04 21:41 ` [PATCH v2 5/6] drivers/raw: " Andre Muezerie
2024-12-04 21:41 ` [PATCH v2 6/6] lib/mldev: " Andre Muezerie
2024-12-05 4:20 ` [PATCH v3 0/7] " Andre Muezerie
2024-12-05 4:20 ` [PATCH v3 1/7] lib/eal: " Andre Muezerie
2024-12-05 4:20 ` [PATCH v3 2/7] drivers/bus: " Andre Muezerie
2024-12-06 12:22 ` Konstantin Ananyev
2024-12-06 16:19 ` Andre Muezerie
2024-12-06 16:41 ` Konstantin Ananyev
2024-12-06 16:43 ` Konstantin Ananyev
2024-12-06 18:14 ` Andre Muezerie
2025-02-04 15:58 ` Thomas Monjalon
2024-12-05 4:20 ` [PATCH v3 3/7] drivers/common: " Andre Muezerie
2024-12-05 4:20 ` [PATCH v3 4/7] drivers/dma: " Andre Muezerie
2024-12-05 4:20 ` [PATCH v3 5/7] drivers/net: " Andre Muezerie
2024-12-05 4:20 ` [PATCH v3 6/7] drivers/raw: " Andre Muezerie
2024-12-05 4:20 ` [PATCH v3 7/7] lib/mldev: " Andre Muezerie
2025-02-04 18:54 ` [PATCH v4 0/7] " Andre Muezerie
2025-02-04 18:54 ` [PATCH v4 1/7] eal: " Andre Muezerie
2025-02-04 18:54 ` [PATCH v4 2/7] drivers/bus: " Andre Muezerie
2025-02-04 18:54 ` [PATCH v4 3/7] drivers/common: " Andre Muezerie
2025-02-04 18:54 ` [PATCH v4 4/7] drivers/dma: " Andre Muezerie
2025-02-04 18:54 ` [PATCH v4 5/7] drivers/net: " Andre Muezerie
2025-02-04 18:54 ` [PATCH v4 6/7] drivers/raw: " Andre Muezerie
2025-02-04 18:54 ` [PATCH v4 7/7] mldev: " Andre Muezerie
2025-02-05 9:15 ` [PATCH v4 0/7] " Bruce Richardson
2025-02-05 15:37 ` Andre Muezerie
2025-02-05 15:47 ` Bruce Richardson
2025-02-05 15:50 ` Konstantin Ananyev
2025-02-05 16:11 ` Andre Muezerie [this message]
2025-02-05 16:12 ` [PATCH v5] eal: define __SIZEOF_LONG__ when using MSVC Andre Muezerie
2024-12-04 20:09 ` [PATCH 2/6] drivers/common: eliminate dependency on non-portable __SIZEOF_LONG__ Andre Muezerie
2024-12-05 1:14 ` Chaoyong He
2024-12-04 20:09 ` [PATCH 3/6] drivers/dma: " Andre Muezerie
2024-12-04 20:09 ` [PATCH 4/6] drivers/net: " Andre Muezerie
2024-12-04 20:09 ` [PATCH 5/6] drivers/raw: " Andre Muezerie
2024-12-04 20:09 ` [PATCH 6/6] lib/mldev: " Andre Muezerie
2024-12-04 21:50 ` [PATCH 0/6] " Stephen Hemminger
2024-12-05 4:19 ` Andre Muezerie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250205161134.GA16706@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net \
--to=andremue@linux.microsoft.com \
--cc=bruce.richardson@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=konstantin.ananyev@huawei.com \
--cc=stephen@networkplumber.org \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).