* [Qemu-devel] [PATCH] disas: avoid including everything in headers compiled from C++
@ 2016-07-07 12:10 Paolo Bonzini
2016-07-07 13:19 ` Markus Armbruster
0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2016-07-07 12:10 UTC (permalink / raw)
To: qemu-devel; +Cc: sbruno, Peter Maydell, Markus Armbruster
disas/arm-a64.cc is careful to include only the bare minimum that
it needs---qemu/osdep.h and disas/bfd.h. Unfortunately, disas/bfd.h
then includes qemu-common.h, which brings in qemu/option.h and from
there we get the kitchen sink.
This causes problems because for example QEMU's atomic macros
conflict with C++ atomic types. But really all that bfd.h needs
is the fprintf_function typedef, so replace the inclusion of
qemu-common.h with qemu/fprintf-fn.h.
Reported-by: Sean Bruno <sbruno@freebsd.org>
Tested-by: Sean Bruno <sbruno@freebsd.org>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
include/disas/bfd.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/disas/bfd.h b/include/disas/bfd.h
index a112e9c..a87b8a1 100644
--- a/include/disas/bfd.h
+++ b/include/disas/bfd.h
@@ -9,7 +9,7 @@
#ifndef DIS_ASM_H
#define DIS_ASM_H
-#include "qemu-common.h"
+#include "qemu/fprintf-fn.h"
typedef void *PTR;
typedef uint64_t bfd_vma;
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] disas: avoid including everything in headers compiled from C++
2016-07-07 12:10 [Qemu-devel] [PATCH] disas: avoid including everything in headers compiled from C++ Paolo Bonzini
@ 2016-07-07 13:19 ` Markus Armbruster
0 siblings, 0 replies; 2+ messages in thread
From: Markus Armbruster @ 2016-07-07 13:19 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel, Peter Maydell, sbruno
Paolo Bonzini <pbonzini@redhat.com> writes:
> disas/arm-a64.cc is careful to include only the bare minimum that
> it needs---qemu/osdep.h and disas/bfd.h. Unfortunately, disas/bfd.h
> then includes qemu-common.h, which brings in qemu/option.h and from
> there we get the kitchen sink.
>
> This causes problems because for example QEMU's atomic macros
> conflict with C++ atomic types. But really all that bfd.h needs
> is the fprintf_function typedef, so replace the inclusion of
> qemu-common.h with qemu/fprintf-fn.h.
>
> Reported-by: Sean Bruno <sbruno@freebsd.org>
> Tested-by: Sean Bruno <sbruno@freebsd.org>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Cc: Markus Armbruster <armbru@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> include/disas/bfd.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/disas/bfd.h b/include/disas/bfd.h
> index a112e9c..a87b8a1 100644
> --- a/include/disas/bfd.h
> +++ b/include/disas/bfd.h
> @@ -9,7 +9,7 @@
> #ifndef DIS_ASM_H
> #define DIS_ASM_H
>
> -#include "qemu-common.h"
> +#include "qemu/fprintf-fn.h"
>
> typedef void *PTR;
> typedef uint64_t bfd_vma;
I'm sitting on a series that purges qemu-common.h from headers. It
makes the same change. I haven't posted it because I want to rebase it
onto the "make check-headers" series first. Anyway,
Reviewed-by: Markus Armbruster <armbru@redhat.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-07-07 13:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-07 12:10 [Qemu-devel] [PATCH] disas: avoid including everything in headers compiled from C++ Paolo Bonzini
2016-07-07 13:19 ` Markus Armbruster
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.