From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: Stefan Weil <sw@weilnetz.de>,
qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: Win32 and ACCEL macro/function
Date: Fri, 6 Aug 2021 10:11:24 +0100 [thread overview]
Message-ID: <YQzy/u0KdSHhkiqy@redhat.com> (raw)
In-Reply-To: <20210806030024.om77dfa4frxtpw7i@habkost.net>
On Thu, Aug 05, 2021 at 11:00:24PM -0400, Eduardo Habkost wrote:
> Hello,
>
> I'm looking for help dealing with a naming conflict when building
> QEMU for Windows hosts.
>
> The summary is: I'm trying to replace the ACCEL() macro in
> include/qemu/accel.h with an inline function, but the ACCEL name
> conflicts with a symbol provided by winuser.h:
>
> In file included from /builds/ehabkost/qemu/include/exec/memory.h:28,
> from /builds/ehabkost/qemu/hw/ppc/mac.h:30,
> from ../hw/pci-host/uninorth.c:27:
> /builds/ehabkost/qemu/include/qemu/accel.h:63:45: error: 'ACCEL' redeclared as different kind of symbol
> 63 | OBJECT_DECLARE_TYPE(AccelState, AccelClass, ACCEL)
> | ^~~~~
> /builds/ehabkost/qemu/include/qom/object.h:178:5: note: in definition of macro 'DECLARE_INSTANCE_CHECKER'
> 178 | OBJ_NAME(const void *obj) \
> | ^~~~~~~~
> /builds/ehabkost/qemu/include/qom/object.h:240:5: note: in expansion of macro 'DECLARE_OBJ_CHECKERS'
> 240 | DECLARE_OBJ_CHECKERS(InstanceType, ClassType, \
> | ^~~~~~~~~~~~~~~~~~~~
> /builds/ehabkost/qemu/include/qemu/accel.h:63:1: note: in expansion of macro 'OBJECT_DECLARE_TYPE'
> 63 | OBJECT_DECLARE_TYPE(AccelState, AccelClass, ACCEL)
> | ^~~~~~~~~~~~~~~~~~~
> In file included from /usr/x86_64-w64-mingw32/sys-root/mingw/include/windows.h:72,
> from /usr/x86_64-w64-mingw32/sys-root/mingw/include/winsock2.h:23,
> from /builds/ehabkost/qemu/include/sysemu/os-win32.h:29,
> from /builds/ehabkost/qemu/include/qemu/osdep.h:135,
> from ../hw/pci-host/uninorth.c:25:
> /usr/x86_64-w64-mingw32/sys-root/mingw/include/winuser.h:1757:5: note: previous declaration of 'ACCEL' was here
> 1757 | } ACCEL,*LPACCEL;
> | ^~~~~
> [338/4278] Compiling C object libqemuutil.a.p/meson-generated_.._trace_trace-scsi.c.obj
> ninja: build stopped: subcommand failed.
> make: *** [Makefile:156: run-ninja] Error 1
>
> (Full log at https://gitlab.com/ehabkost/qemu/-/jobs/1481978645)
>
> Does anybody more experienced with Win32 have a suggestion on how
> to deal with this? Do we really need to include winsock2.h /
> windows.h / winuser.h from qemu/osdep.h?
Yep, they're the equivalent of the standard posix headers we would
need on non-Linux.
Windows header files are well known for having many annoyingly common
names used in macros/symbols, so you pretty much just have to rename
whatever is in your app that clashes.
I'd suggest we use CPUACCEL / CpuAccel or something like that in
QEMU.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
prev parent reply other threads:[~2021-08-06 9:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-06 3:00 Win32 and ACCEL macro/function Eduardo Habkost
2021-08-06 9:11 ` Daniel P. Berrangé [this message]
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=YQzy/u0KdSHhkiqy@redhat.com \
--to=berrange@redhat.com \
--cc=ehabkost@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=sw@weilnetz.de \
/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).