[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 19/26] osdep: Make os-win32.h and os-posix.h handle 'extern "C"' t
From: |
Peter Maydell |
Subject: |
[PULL 19/26] osdep: Make os-win32.h and os-posix.h handle 'extern "C"' themselves |
Date: |
Mon, 10 May 2021 13:25:41 +0100 |
Both os-win32.h and os-posix.h include system header files. Instead
of having osdep.h include them inside its 'extern "C"' block, make
these headers handle that themselves, so that we don't include the
system headers inside 'extern "C"'.
This doesn't fix any current problems, but it's conceptually the
right way to handle system headers.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
include/qemu/osdep.h | 8 ++++----
include/sysemu/os-posix.h | 8 ++++++++
include/sysemu/os-win32.h | 8 ++++++++
3 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index cb2a07e472e..4c6f2390be4 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -131,10 +131,6 @@ QEMU_EXTERN_C int daemon(int, int);
*/
#include "glib-compat.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#ifdef _WIN32
#include "sysemu/os-win32.h"
#endif
@@ -143,6 +139,10 @@ extern "C" {
#include "sysemu/os-posix.h"
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "qemu/typedefs.h"
/*
diff --git a/include/sysemu/os-posix.h b/include/sysemu/os-posix.h
index 629c8c648b7..2edf33658a4 100644
--- a/include/sysemu/os-posix.h
+++ b/include/sysemu/os-posix.h
@@ -38,6 +38,10 @@
#include <sys/sysmacros.h>
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void os_set_line_buffering(void);
void os_set_proc_name(const char *s);
void os_setup_signal_handling(void);
@@ -92,4 +96,8 @@ static inline void qemu_funlockfile(FILE *f)
funlockfile(f);
}
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h
index 5346d51e890..43f569b5c21 100644
--- a/include/sysemu/os-win32.h
+++ b/include/sysemu/os-win32.h
@@ -30,6 +30,10 @@
#include <windows.h>
#include <ws2tcpip.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#if defined(_WIN64)
/* On w64, setjmp is implemented by _setjmp which needs a second parameter.
* If this parameter is NULL, longjump does no stack unwinding.
@@ -194,4 +198,8 @@ ssize_t qemu_recv_wrap(int sockfd, void *buf, size_t len,
int flags);
ssize_t qemu_recvfrom_wrap(int sockfd, void *buf, size_t len, int flags,
struct sockaddr *addr, socklen_t *addrlen);
+#ifdef __cplusplus
+}
+#endif
+
#endif
--
2.20.1
- [PULL 09/26] target/arm: Move vfp_{load, store}_reg{32, 64} to translate-vfp.c.inc, (continued)
- [PULL 09/26] target/arm: Move vfp_{load, store}_reg{32, 64} to translate-vfp.c.inc, Peter Maydell, 2021/05/10
- [PULL 11/26] target/arm: Make translate-vfp.c.inc its own compilation unit, Peter Maydell, 2021/05/10
- [PULL 14/26] target/arm: Move NeonGenThreeOpEnvFn typedef to translate.h, Peter Maydell, 2021/05/10
- [PULL 15/26] target/arm: Make functions used by translate-neon global, Peter Maydell, 2021/05/10
- [PULL 13/26] target/arm: Delete unused typedef, Peter Maydell, 2021/05/10
- [PULL 16/26] target/arm: Make translate-neon.c.inc its own compilation unit, Peter Maydell, 2021/05/10
- [PULL 18/26] hw/sd/omap_mmc: Use device_cold_reset() instead of device_legacy_reset(), Peter Maydell, 2021/05/10
- [PULL 17/26] target/arm: Make WFI a NOP for userspace emulators, Peter Maydell, 2021/05/10
- [PULL 22/26] hw/arm/imx25_pdk: Fix error message for invalid RAM size, Peter Maydell, 2021/05/10
- [PULL 20/26] include/qemu/bswap.h: Handle being included outside extern "C" block, Peter Maydell, 2021/05/10
- [PULL 19/26] osdep: Make os-win32.h and os-posix.h handle 'extern "C"' themselves,
Peter Maydell <=
- [PULL 21/26] include/disas/dis-asm.h: Handle being included outside 'extern "C"', Peter Maydell, 2021/05/10
- [PULL 23/26] hw/misc/mps2-scc: Add "QEMU interface" comment, Peter Maydell, 2021/05/10
- [PULL 25/26] hw/arm/mps2-tz: Implement AN524 memory remapping via machine property, Peter Maydell, 2021/05/10
- [PULL 24/26] hw/misc/mps2-scc: Support using CFG0 bit 0 for remapping, Peter Maydell, 2021/05/10
- [PULL 26/26] hw/arm/xlnx: Fix PHY address for xilinx-zynq-a9, Peter Maydell, 2021/05/10