qemu/include/disas/capstone.h
Gustavo Romero 9971cbac2f disas: Fix build against Capstone v6
Capstone v6 made major changes, such as renaming for AArch64, which
broke programs using the old headers, like QEMU. However, Capstone v6
provides the CAPSTONE_AARCH64_COMPAT_HEADER compatibility definition
allowing to build against v6 with the old definitions, so fix the QEMU
build using it.

We can lift that definition and switch to the new naming once our
supported distros have Capstone v6 in place.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Link: https://lore.kernel.org/r/20240715213943.1210355-1-gustavo.romero@linaro.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-07-16 18:18:24 +02:00

40 lines
1013 B
C

#ifndef QEMU_CAPSTONE_H
#define QEMU_CAPSTONE_H
#ifdef CONFIG_CAPSTONE
#define CAPSTONE_AARCH64_COMPAT_HEADER
#include <capstone.h>
#else
/* Just enough to allow backends to init without ifdefs. */
#define CS_ARCH_ARM -1
#define CS_ARCH_ARM64 -1
#define CS_ARCH_MIPS -1
#define CS_ARCH_X86 -1
#define CS_ARCH_PPC -1
#define CS_ARCH_SPARC -1
#define CS_ARCH_SYSZ -1
#define CS_MODE_LITTLE_ENDIAN 0
#define CS_MODE_BIG_ENDIAN 0
#define CS_MODE_ARM 0
#define CS_MODE_16 0
#define CS_MODE_32 0
#define CS_MODE_64 0
#define CS_MODE_THUMB 0
#define CS_MODE_MCLASS 0
#define CS_MODE_V8 0
#define CS_MODE_MICRO 0
#define CS_MODE_MIPS3 0
#define CS_MODE_MIPS32R6 0
#define CS_MODE_MIPSGP64 0
#define CS_MODE_V9 0
#define CS_MODE_MIPS32 0
#define CS_MODE_MIPS64 0
#endif /* CONFIG_CAPSTONE */
#endif /* QEMU_CAPSTONE_H */