vl.c: Fix OpenBSD compilation issue due to namespace collisions
PATCH v2 1/1 vl.c: Fix OpenBSD compilation issue due to namespace collisions
Machine rewriting added MACHINE macro which is
already in use by other OpenBSD library.
Since qemu/sockets.h exposes the OpenBSD namespace,
the minimalistic approach is to add it as the first QEMU include.
---
V1 -> V2
#undef MACHINE to avoid introducing warnings for redefining the macro.
include/hw/boards.h | 1 + vl.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
include/hw/boards.h +1 -0
@@ -54,6 +54,7 @@ struct QEMUMachine {int qemu_register_machine (QEMUMachine *m);#define TYPE_MACHINE "machine" +#undef MACHINE/* BSD defines it and QEMU does not use it */ #define MACHINE (obj) \ OBJECT_CHECK(MachineState, (obj), TYPE_MACHINE)#define MACHINE_GET_CLASS (obj) \
vl.c +1 -1
@@ -58,6 +58,7 @@ int main(int argc, char **argv)#include <glib.h> +#include "qemu/sockets.h" #include "hw/hw.h" #include "hw/boards.h" #include "hw/usb.h"
@@ -103,7 +104,6 @@ int main(int argc, char **argv)#include "disas/disas.h" -#include "qemu/sockets.h" #include "slirp/libslirp.h"
Signature · 1 line
1.8.3.1
Am 18.03.2014 16:26, schrieb Marcel Apfelbaum:
Quoted 32 lines
Machine rewriting added MACHINE macro which is
already in use by other OpenBSD library.
Sinceqemu/sockets.hexposes the OpenBSD namespace,
the minimalistic approach is to add it as the first QEMU include.Reported-by Brad Smith <[email protected]>Signed-off-by Marcel Apfelbaum <[email protected]>---
V1 -> V2
#undef MACHINE to avoid introducing warnings for redefining the macro.include/hw/boards.h | 1 + vl.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)include/hw/boards.h +1
-0@@ -54,6 +54,7 @@ struct QEMUMachine {int qemu_register_machine (QEMUMachine *m);#define TYPE_MACHINE "machine" +#undef MACHINE/* BSD defines it and QEMU does not use it */ #define MACHINE (obj) \ OBJECT_CHECK(MachineState, (obj), TYPE_MACHINE)#define MACHINE_GET_CLASS (obj) \vl.c +0
-0
vl.c int main(int argc, char **argv) · line 64
Quoted 7 lines
vl.c +1
-0@@ -58,6 +58,7 @@ int main(int argc, char **argv)#include <glib.h> +#include "qemu/sockets.h" #include "hw/hw.h" #include "hw/boards.h" #include "hw/usb.h"
Thanks, I've queued this for testing but would probably like to add a comment explaining why this is placed there.
https://github.com/afaerber/qemu-cpu/commits/qom-next
Andreas
Quoted 9 lines
vl.c +0
-1@@ -103,7 +104,6 @@ int main(int argc, char **argv)#include "disas/disas.h" -#include "qemu/sockets.h" #include "slirp/libslirp.h"
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Quoted 7 lines · Marcel Apfelbaum
Machine rewriting added MACHINE macro which is
already in use by other OpenBSD library.
Sinceqemu/sockets.hexposes the OpenBSD namespace,
the minimalistic approach is to add it as the first QEMU include.Reported-by Brad Smith <[email protected]>Signed-off-by Marcel Apfelbaum <[email protected]>
Thank you for the workaround for the namespace collision.
Signature · 3 lines
This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.