qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qemu-pixman.h: Avoid mutual inclusion loop with console.h
@ 2013-01-17 15:52 Peter Maydell
  2013-01-18 13:47 ` Stefan Hajnoczi
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Maydell @ 2013-01-17 15:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Paolo Bonzini, patches

Remove an unnecessary mutual inclusion loop between qemu-pixman.h and
console.h, since the former was only including the latter for
'PixelFormat*', which can be provided by typedefs.h.  This requires a
minor adjustment to qemu-pixman.c, which was relying on the implicit
inclusion of console.h for the actual struct PixelFormat definition,
and on implicitly dragging in a header defining NULL.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
I noticed this because I had an out of tree file which included
ui/console.h before qemu-common.h and it didn't compile. But mutual
include loops are a bad idea anyway IMHO.

 include/ui/qemu-pixman.h |    2 +-
 ui/qemu-pixman.c         |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/ui/qemu-pixman.h b/include/ui/qemu-pixman.h
index 016fd87..b032f52 100644
--- a/include/ui/qemu-pixman.h
+++ b/include/ui/qemu-pixman.h
@@ -15,7 +15,7 @@
 #pragma GCC diagnostic error "-Wredundant-decls"
 #endif
 
-#include "console.h"
+#include "qemu/typedefs.h"
 
 /*
  * pixman image formats are defined to be native endian,
diff --git a/ui/qemu-pixman.c b/ui/qemu-pixman.c
index 609335a..6dcbe90 100644
--- a/ui/qemu-pixman.c
+++ b/ui/qemu-pixman.c
@@ -3,7 +3,8 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include "ui/qemu-pixman.h"
+#include "qemu-common.h"
+#include "ui/console.h"
 
 int qemu_pixman_get_type(int rshift, int gshift, int bshift)
 {
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu-pixman.h: Avoid mutual inclusion loop with console.h
  2013-01-17 15:52 [Qemu-devel] [PATCH] qemu-pixman.h: Avoid mutual inclusion loop with console.h Peter Maydell
@ 2013-01-18 13:47 ` Stefan Hajnoczi
  2013-01-18 13:52   ` Peter Maydell
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Hajnoczi @ 2013-01-18 13:47 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-trivial, Paolo Bonzini, qemu-devel, patches

On Thu, Jan 17, 2013 at 03:52:08PM +0000, Peter Maydell wrote:
> Remove an unnecessary mutual inclusion loop between qemu-pixman.h and
> console.h, since the former was only including the latter for
> 'PixelFormat*', which can be provided by typedefs.h.  This requires a
> minor adjustment to qemu-pixman.c, which was relying on the implicit
> inclusion of console.h for the actual struct PixelFormat definition,
> and on implicitly dragging in a header defining NULL.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> I noticed this because I had an out of tree file which included
> ui/console.h before qemu-common.h and it didn't compile. But mutual
> include loops are a bad idea anyway IMHO.
> 
>  include/ui/qemu-pixman.h |    2 +-
>  ui/qemu-pixman.c         |    3 ++-
>  2 files changed, 3 insertions(+), 2 deletions(-)

CC    ui/curses.o
In file included from ui/spice-core.c:40:0:
/home/stefanha/qemu/include/ui/spice-display.h:93:5: error: unknown type name ‘QEMUCursor’

Stefan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu-pixman.h: Avoid mutual inclusion loop with console.h
  2013-01-18 13:47 ` Stefan Hajnoczi
@ 2013-01-18 13:52   ` Peter Maydell
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2013-01-18 13:52 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: qemu-trivial, Paolo Bonzini, qemu-devel, patches

On 18 January 2013 13:47, Stefan Hajnoczi <stefanha@gmail.com> wrote:
> On Thu, Jan 17, 2013 at 03:52:08PM +0000, Peter Maydell wrote:
>> Remove an unnecessary mutual inclusion loop between qemu-pixman.h and
>> console.h, since the former was only including the latter for
>> 'PixelFormat*', which can be provided by typedefs.h.  This requires a
>> minor adjustment to qemu-pixman.c, which was relying on the implicit
>> inclusion of console.h for the actual struct PixelFormat definition,
>> and on implicitly dragging in a header defining NULL.

> CC    ui/curses.o
> In file included from ui/spice-core.c:40:0:
> /home/stefanha/qemu/include/ui/spice-display.h:93:5: error: unknown type name ‘QEMUCursor’

Oops. I don't have spice in my dev environment I guess.
Having spice-display.h include console.h will probably fix this.

-- PMM

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-01-18 13:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-17 15:52 [Qemu-devel] [PATCH] qemu-pixman.h: Avoid mutual inclusion loop with console.h Peter Maydell
2013-01-18 13:47 ` Stefan Hajnoczi
2013-01-18 13:52   ` Peter Maydell

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).