From 6ac231ff04e8c1bcdd1e23bc2f04af1eae481cd5 Mon Sep 17 00:00:00 2001 From: Rot127 <45763064+Rot127@users.noreply.github.com> Date: Mon, 18 Dec 2023 00:36:54 +0000 Subject: [PATCH] Add CS_aarch64 macro without parameter. (#2219) --- include/capstone/capstone.h | 6 ++++++ tests/test_arm64.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/capstone/capstone.h b/include/capstone/capstone.h index 9efef221..46d0563c 100644 --- a/include/capstone/capstone.h +++ b/include/capstone/capstone.h @@ -89,6 +89,12 @@ extern "C" { #define CS_AARCH64_VL_(x) AArch64Layout_VL_##x #endif +#if CS_NEXT_VERSION < 6 +#define CS_aarch64_ arm64 +#else +#define CS_aarch64_ aarch64 +#endif + #if CS_NEXT_VERSION < 6 #define CS_aarch64(x) arm64##x #else diff --git a/tests/test_arm64.c b/tests/test_arm64.c index 048b9f00..f4651fc5 100644 --- a/tests/test_arm64.c +++ b/tests/test_arm64.c @@ -247,7 +247,7 @@ void test_macros() { CS_cs_aarch64() arm64_detail = { 0 }; detail.arm64 = arm64_detail; CS_aarch64_op() op = { 0 }; - detail.CS_aarch64().operands[0] = op; + detail.CS_aarch64_.operands[0] = op; CS_aarch64_reg() reg = 1; CS_aarch64_cc() cc = ARM64_CC_AL; CS_aarch64_extender() arm64_extender = ARM64_EXT_SXTB;