aboutsummaryrefslogtreecommitdiff
path: root/include/qemu-common.h
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-07-03 15:18:24 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2015-07-06 14:59:09 +0200
commitfba0a593b2809ecdda68650952cf3d3332ac1990 (patch)
treea5810e02760af31710c62e4d67d10239c60159a4 /include/qemu-common.h
parentde7ea885c5394c1fba7443cbf33bd2745d32e6c2 (diff)
downloadqemu-fba0a593b2809ecdda68650952cf3d3332ac1990.zip
qemu-fba0a593b2809ecdda68650952cf3d3332ac1990.tar.gz
qemu-fba0a593b2809ecdda68650952cf3d3332ac1990.tar.bz2
Stop including qemu-common.h in memory.h
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. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <1435933104-15216-1-git-send-email-peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/qemu-common.h')
-rw-r--r--include/qemu-common.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/include/qemu-common.h b/include/qemu-common.h
index 5be3cdd..237d654 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -15,6 +15,7 @@
#include "qemu/compiler.h"
#include "config-host.h"
#include "qemu/typedefs.h"
+#include "qemu/fprintf-fn.h"
#if defined(__arm__) || defined(__sparc__) || defined(__mips__) || defined(__hppa__) || defined(__ia64__)
#define WORDS_ALIGNED
@@ -85,9 +86,6 @@
# error Unknown pointer size
#endif
-typedef int (*fprintf_function)(FILE *f, const char *fmt, ...)
- GCC_FMT_ATTR(2, 3);
-
#ifdef _WIN32
#define fsync _commit
#if !defined(lseek)