This is an automated email from Gerrit. "Antonio Borneo <borneo.anto...@gmail.com>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/7224
-- gerrit commit 8fc25241e350aea631cec5141a6342114839fa86 Author: Antonio Borneo <borneo.anto...@gmail.com> Date: Mon Sep 26 15:32:24 2022 +0200 openocd: fix build with 'configure --without-capstone' When configure option --without-capstone is used, the macro HAVE_CAPSTONE is not defined in config.h, and the following lines are instead present: /* 1 if you have Capstone disassembly framework. */ /* #undef HAVE_CAPSTONE */ This cause compile error with message: arm_disassembler.h:190:5: error: "HAVE_CAPSTONE" is not defined, evaluates to 0 [-Werror=undef] 190 | #if HAVE_CAPSTONE | ^~~~~~~~~~~~~ Replace the incorrect lines: #if HAVE_CAPSTONE with: #ifdef HAVE_CAPSTONE Change-Id: Ie5ac98b2c25746dd721812c91baaac61ec877ecd Signed-off-by: Antonio Borneo <borneo.anto...@gmail.com> diff --git a/src/target/a64_disassembler.c b/src/target/a64_disassembler.c index ca3d3ea7a9..3ae5d9c27b 100644 --- a/src/target/a64_disassembler.c +++ b/src/target/a64_disassembler.c @@ -13,7 +13,7 @@ #include "target.h" #include "a64_disassembler.h" -#if HAVE_CAPSTONE +#ifdef HAVE_CAPSTONE #include <capstone.h> diff --git a/src/target/arm_disassembler.c b/src/target/arm_disassembler.c index 749274f369..29d57ab12d 100644 --- a/src/target/arm_disassembler.c +++ b/src/target/arm_disassembler.c @@ -15,7 +15,7 @@ #include "arm_disassembler.h" #include <helper/log.h> -#if HAVE_CAPSTONE +#ifdef HAVE_CAPSTONE #include <capstone.h> #endif @@ -3020,7 +3020,7 @@ int arm_access_size(struct arm_instruction *instruction) } } -#if HAVE_CAPSTONE +#ifdef HAVE_CAPSTONE static void print_opcode(struct command_invocation *cmd, const cs_insn *insn) { uint32_t opcode = 0; diff --git a/src/target/arm_disassembler.h b/src/target/arm_disassembler.h index 1be567475c..f9abb46737 100644 --- a/src/target/arm_disassembler.h +++ b/src/target/arm_disassembler.h @@ -187,7 +187,7 @@ int arm_evaluate_opcode(uint32_t opcode, uint32_t address, int thumb_evaluate_opcode(uint16_t opcode, uint32_t address, struct arm_instruction *instruction); int arm_access_size(struct arm_instruction *instruction); -#if HAVE_CAPSTONE +#ifdef HAVE_CAPSTONE int arm_disassemble(struct command_invocation *cmd, struct target *target, target_addr_t address, size_t count, bool thumb_mode); #endif diff --git a/src/target/armv4_5.c b/src/target/armv4_5.c index 48af5035a0..d42037d44f 100644 --- a/src/target/armv4_5.c +++ b/src/target/armv4_5.c @@ -936,7 +936,7 @@ COMMAND_HANDLER(handle_arm_core_state_command) COMMAND_HANDLER(handle_arm_disassemble_command) { -#if HAVE_CAPSTONE +#ifdef HAVE_CAPSTONE struct target *target = get_current_target(CMD_CTX); if (!target) { --