[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 1/7] osdep: include glib-compat.h before other QEMU headers
From: |
Peter Maydell |
Subject: |
[PULL 1/7] osdep: include glib-compat.h before other QEMU headers |
Date: |
Sat, 17 Apr 2021 20:41:59 +0100 |
From: Paolo Bonzini <pbonzini@redhat.com>
glib-compat.h is sort of like a system header, and it needs to include
system headers (glib.h) that may dislike being included under
'extern "C"'. Move it right after all system headers and before
all other QEMU headers.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20210416135543.20382-2-peter.maydell@linaro.org
[PMM: Added comment about why glib-compat.h is special]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
include/qemu/osdep.h | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index ba15be9c569..ab84ecc7c1c 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -111,6 +111,13 @@ extern int daemon(int, int);
#define WEXITSTATUS(x) (x)
#endif
+/*
+ * This is somewhat like a system header; it must be outside any extern "C"
+ * block because it includes system headers itself, including glib.h,
+ * which will not compile if inside an extern "C" block.
+ */
+#include "glib-compat.h"
+
#ifdef _WIN32
#include "sysemu/os-win32.h"
#endif
@@ -123,7 +130,6 @@ extern int daemon(int, int);
#include <AvailabilityMacros.h>
#endif
-#include "glib-compat.h"
#include "qemu/typedefs.h"
/*
--
2.20.1
- [PULL 0/7] queue of proposed rc4 fixes, Peter Maydell, 2021/04/17
- [PULL 1/7] osdep: include glib-compat.h before other QEMU headers,
Peter Maydell <=
- [PULL 2/7] osdep: protect qemu/osdep.h with extern "C", Peter Maydell, 2021/04/17
- [PULL 4/7] hw/arm/armsse: Give SSE-300 its own Property array, Peter Maydell, 2021/04/17
- [PULL 3/7] include/qemu/osdep.h: Move system includes to top, Peter Maydell, 2021/04/17
- [PULL 5/7] hw/arm/armsse: Make SSE-300 use Cortex-M55, Peter Maydell, 2021/04/17
- [PULL 6/7] target/arm: drop CF_LAST_IO/dc->condjump check, Peter Maydell, 2021/04/17
- [PULL 7/7] accel/tcg: avoid re-translating one-shot instructions, Peter Maydell, 2021/04/17
- Re: [PULL 0/7] queue of proposed rc4 fixes, no-reply, 2021/04/17
- Re: [PULL 0/7] queue of proposed rc4 fixes, Philippe Mathieu-Daudé, 2021/04/18
- Re: [PULL 0/7] queue of proposed rc4 fixes, Alex Bennée, 2021/04/18