qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Stop including qemu-common.h in memory.h


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] Stop including qemu-common.h in memory.h
Date: Fri, 3 Jul 2015 18:45:55 +0100

On 3 July 2015 at 18:26, Markus Armbruster <address@hidden> wrote:
> Peter Maydell <address@hidden> writes:
>
>> Including qemu-common.h from other header files is generally a bad
>> idea, because it means it's very easy to end up with a circular
>> dependency. For instance, if we wanted to include memory.h from
>> qom/cpu.h we'd end up with this loop:
>>  memory.h -> qemu-common.h -> cpu.h -> cpu-qom.h -> qom/cpu.h -> memory.h
>>
>> Remove the include from memory.h. This requires us to fix up a few
>> other files which were inadvertently getting declarations indirectly
>> through memory.h.
>>
>> The biggest change is splitting the fprintf_function typedef out
>> into its own header so other headers can get at it without having
>> to include qemu-common.h.
>
> Why not simply put it in qemu/typedefs.h?

I thought about that, but that header claims it is specifically for
opaque typedefs, and also I didn't really want to add the stdio.h
and compiler.h includes to it.

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]