[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] qemu/atomic.h: prefix qemu_ to solve <stdatomic.h> collisions
- To: Daniel P. Berrangé <berrange@xxxxxxxxxx>
- From: Stefan Hajnoczi <stefanha@xxxxxxxxxx>
- Date: Wed, 23 Sep 2020 10:14:07 +0100
- Authentication-results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=stefanha@xxxxxxxxxx
- Cc: Paolo Bonzini <pbonzini@xxxxxxxxxx>, David Hildenbrand <david@xxxxxxxxxx>, qemu-devel@xxxxxxxxxx, Fam Zheng <fam@xxxxxxxxxx>, Peter Maydell <peter.maydell@xxxxxxxxxx>, sheepdog@xxxxxxxxxxxxxx, kvm@xxxxxxxxxxxxxxx, "Michael S. Tsirkin" <mst@xxxxxxxxxx>, Jason Wang <jasowang@xxxxxxxxxx>, Yuval Shaia <yuval.shaia.ml@xxxxxxxxx>, Markus Armbruster <armbru@xxxxxxxxxx>, Max Filippov <jcmvbkbc@xxxxxxxxx>, Alistair Francis <Alistair.Francis@xxxxxxx>, Gerd Hoffmann <kraxel@xxxxxxxxxx>, Huacai Chen <chenhc@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Alberto Garcia <berto@xxxxxxxxxx>, Sagar Karandikar <sagark@xxxxxxxxxxxxxxxxx>, Yoshinori Sato <ysato@xxxxxxxxxxxxxxxxxxxx>, Juan Quintela <quintela@xxxxxxxxxx>, Jiri Slaby <jslaby@xxxxxxx>, Paul Durrant <paul@xxxxxxx>, Michael Roth <mdroth@xxxxxxxxxxxxxxxxxx>, Halil Pasic <pasic@xxxxxxxxxxxxx>, Christian Borntraeger <borntraeger@xxxxxxxxxx>, Aleksandar Markovic <aleksandar.qemu.devel@xxxxxxxxx>, Thomas Huth <thuth@xxxxxxxxxx>, Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>, Matthew Rosato <mjrosato@xxxxxxxxxxxxx>, Aleksandar Rikalo <aleksandar.rikalo@xxxxxxxxxx>, Eduardo Habkost <ehabkost@xxxxxxxxxx>, Stefan Weil <sw@xxxxxxxxxxx>, Peter Lieven <pl@xxxxxxx>, "Dr. David Alan Gilbert" <dgilbert@xxxxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, qemu-s390x@xxxxxxxxxx, qemu-arm@xxxxxxxxxx, Liu Yuan <namei.unix@xxxxxxxxx>, qemu-riscv@xxxxxxxxxx, Sunil Muthuswamy <sunilmut@xxxxxxxxxxxxx>, John Snow <jsnow@xxxxxxxxxx>, Hailiang Zhang <zhang.zhanghailiang@xxxxxxxxxx>, Richard Henderson <rth@xxxxxxxxxxx>, Kevin Wolf <kwolf@xxxxxxxxxx>, qemu-block@xxxxxxxxxx, Bastian Koppelmann <kbastian@xxxxxxxxxxxxxxxxxxxxx>, Cornelia Huck <cohuck@xxxxxxxxxx>, Laurent Vivier <laurent@xxxxxxxxx>, Max Reitz <mreitz@xxxxxxxxxx>, Palmer Dabbelt <palmer@xxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Aurelien Jarno <aurelien@xxxxxxxxxxx>
- Delivery-date: Wed, 23 Sep 2020 09:14:39 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Tue, Sep 22, 2020 at 09:18:49AM +0100, Daniel P. Berrangé wrote:
> On Tue, Sep 22, 2020 at 08:56:06AM +0200, Paolo Bonzini wrote:
> > On 22/09/20 08:45, David Hildenbrand wrote:
> > >> It's certainly a good idea but it's quite verbose.
> > >>
> > >> What about using atomic__* as the prefix? It is not very common in QEMU
> > >> but there are some cases (and I cannot think of anything better).
> > >
> > > aqomic_*, lol :)
> >
> > Actually qatomic_ would be a good one, wouldn't it?
>
> Yes, I think just adding a 'q' on the front of methods is more than
> sufficient (see also all the qcrypto_*, qio_* APIs I wrote). The
> only think a plain 'q' prefix is likely to clash with is the Qt
> library and that isn't something we're likely to link with (famous
> last words...).
This is why I didn't use "qatomic". "atomic" feels too common to prefix
with just a single letter.
But I grepped /usr/include and code searched GitHub. I can't find any
uses of "qatomic_" so it looks safe. FWIW Qt does have qatomic.h but
doesn't use the name for identifiers in the code.
Let's do it!
Stefan
Attachment:
signature.asc
Description: PGP signature
|