From 37b248a3bec25922330136a6e483f9c084e61282 Mon Sep 17 00:00:00 2001 From: Rot127 Date: Sun, 17 Dec 2023 13:18:51 -0500 Subject: [PATCH] Add CS_aarch64 macro without parameter. MSVC will throw C4003 if a macro with an argument is used, without setting the argument. Hence we need one for this use case. --- include/capstone/capstone.h | 6 ++++++ tests/test_aarch64.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/capstone/capstone.h b/include/capstone/capstone.h index 7ca26531a7..3f0b987a35 100644 --- a/include/capstone/capstone.h +++ b/include/capstone/capstone.h @@ -90,6 +90,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_aarch64.c b/tests/test_aarch64.c index e23f731753..a5e74f19e8 100644 --- a/tests/test_aarch64.c +++ b/tests/test_aarch64.c @@ -341,7 +341,7 @@ int test_macros() { CS_cs_aarch64() aarch64_detail = { 0 }; detail.aarch64 = aarch64_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 = AArch64CC_AL; CS_aarch64_extender() aarch64_extender = AArch64_EXT_SXTB;