|
From: openocd-gerrit <ope...@us...> - 2026-04-06 16:45:42
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via a22e4331e7c9a7377e63dcd3de151e82f9b5ddbf (commit)
from faab1de8b1129b35f129e81d76b43e9813d0ceef (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit a22e4331e7c9a7377e63dcd3de151e82f9b5ddbf
Author: Marc Schink <de...@za...>
Date: Wed Mar 11 12:55:25 2026 +0100
configure: Rework HAVE_CAPSTONE #define
Autotools and the current build system define HAVE_* macros only when
the corresponding feature is available, leaving them undefined otherwise.
HAVE_CAPSTONE is an exception, align it with this convention to make the
build system more consistent and slightly simpler.
Change-Id: I0b71743a687802b905e3fe1e17cad815a7febb14
Signed-off-by: Marc Schink <de...@za...>
Reviewed-on: https://review.openocd.org/c/openocd/+/9540
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/configure.ac b/configure.ac
index 39f5e074e..0d5f0eb35 100644
--- a/configure.ac
+++ b/configure.ac
@@ -527,10 +527,6 @@ AS_IF([test "x$enable_capstone" != xno], [
])
])
-AS_IF([test "x$enable_capstone" == xno], [
- AC_DEFINE([HAVE_CAPSTONE], [0], [0 if you don't have Capstone disassembly framework.])
-])
-
for hidapi_lib in hidapi hidapi-hidraw hidapi-libusb; do
PKG_CHECK_MODULES([HIDAPI],[$hidapi_lib],[
use_hidapi=yes
diff --git a/src/target/a64_disassembler.c b/src/target/a64_disassembler.c
index ca3d3ea7a..3ae5d9c27 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 6dea19f93..e07843afd 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
@@ -3019,7 +3019,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 8317da997..34df0f1f0 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 4f61c58e2..d9816d033 100644
--- a/src/target/armv4_5.c
+++ b/src/target/armv4_5.c
@@ -952,7 +952,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) {
-----------------------------------------------------------------------
Summary of changes:
configure.ac | 4 ----
src/target/a64_disassembler.c | 2 +-
src/target/arm_disassembler.c | 4 ++--
src/target/arm_disassembler.h | 2 +-
src/target/armv4_5.c | 2 +-
5 files changed, 5 insertions(+), 9 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|