[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 21/26] include/disas/dis-asm.h: Handle being included outside 'ext
From: |
Peter Maydell |
Subject: |
[PULL 21/26] include/disas/dis-asm.h: Handle being included outside 'extern "C"' |
Date: |
Mon, 10 May 2021 13:25:43 +0100 |
Make dis-asm.h handle being included outside an 'extern "C"' block;
this allows us to remove the 'extern "C"' blocks that our two C++
files that include it are using.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
include/disas/dis-asm.h | 12 ++++++++++--
disas/arm-a64.cc | 2 --
disas/nanomips.cpp | 2 --
3 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/include/disas/dis-asm.h b/include/disas/dis-asm.h
index 13fa1edd411..4701445e806 100644
--- a/include/disas/dis-asm.h
+++ b/include/disas/dis-asm.h
@@ -9,6 +9,12 @@
#ifndef DISAS_DIS_ASM_H
#define DISAS_DIS_ASM_H
+#include "qemu/bswap.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef void *PTR;
typedef uint64_t bfd_vma;
typedef int64_t bfd_signed_vma;
@@ -479,8 +485,6 @@ bool cap_disas_plugin(disassemble_info *info, uint64_t pc,
size_t size);
/* from libbfd */
-#include "qemu/bswap.h"
-
static inline bfd_vma bfd_getl64(const bfd_byte *addr)
{
return ldq_le_p(addr);
@@ -508,4 +512,8 @@ static inline bfd_vma bfd_getb16(const bfd_byte *addr)
typedef bool bfd_boolean;
+#ifdef __cplusplus
+}
+#endif
+
#endif /* DISAS_DIS_ASM_H */
diff --git a/disas/arm-a64.cc b/disas/arm-a64.cc
index 27613d4b256..a1402a2e071 100644
--- a/disas/arm-a64.cc
+++ b/disas/arm-a64.cc
@@ -18,9 +18,7 @@
*/
#include "qemu/osdep.h"
-extern "C" {
#include "disas/dis-asm.h"
-}
#include "vixl/a64/disasm-a64.h"
diff --git a/disas/nanomips.cpp b/disas/nanomips.cpp
index 8ddef897f0d..9be8df75dd6 100644
--- a/disas/nanomips.cpp
+++ b/disas/nanomips.cpp
@@ -28,9 +28,7 @@
*/
#include "qemu/osdep.h"
-extern "C" {
#include "disas/dis-asm.h"
-}
#include <cstring>
#include <stdexcept>
--
2.20.1
- [PULL 11/26] target/arm: Make translate-vfp.c.inc its own compilation unit, (continued)
- [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, 2021/05/10
- [PULL 21/26] include/disas/dis-asm.h: Handle being included outside 'extern "C"',
Peter Maydell <=
- [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