qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [Discussion 02/10] NEED_CPU_H: remove '#include "cpu.h"


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [Discussion 02/10] NEED_CPU_H: remove '#include "cpu.h"' from include/qemu-common.h
Date: Tue, 04 Mar 2014 13:09:49 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

Il 04/03/2014 13:02, Xuebing wang ha scritto:

Of these, vl.c and linux-user/elfload.c should not include
disas/disas.h at all, and hw/core/loader.c is !NEED_CPU_H.  So there
are just two files where you can add a #include "cpu.h" manually.


My idea is to keep disas/disas.h correct just by itself, regardless how
it's used by *.c files.

In general, it's a good idea to make headers self-contained by recursively including whatever's necessary.

However, there are a few very central headers that are just too complicated to make self-consistent without introducing circular references.

In particular, for QEMU these are qemu-common.h and cpu.h (and also others, such as exec-all.h but perhaps the solution there is to split them). It's much simpler to ask people to include these two files in the C files.

Paolo



reply via email to

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