aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Borneo <borneo.antonio@gmail.com>2022-04-25 23:04:49 +0200
committerAntonio Borneo <borneo.antonio@gmail.com>2022-05-07 11:04:18 +0000
commit7819834ace37ca7f5d1b834c761dfcb9964ef845 (patch)
tree57221db1300827b158fddf7d86a530814177ff50
parentad5ca263e931792483cdb2a820b7aba3980829eb (diff)
downloadriscv-openocd-7819834ace37ca7f5d1b834c761dfcb9964ef845.zip
riscv-openocd-7819834ace37ca7f5d1b834c761dfcb9964ef845.tar.gz
riscv-openocd-7819834ace37ca7f5d1b834c761dfcb9964ef845.tar.bz2
target: fix build with jimtcl 0.79
In jimtcl 0.80 the prototype of Jim_DictPairs() has changed. The only code in OpenOCD that uses Jim_DictPairs() has been merged recently and it only uses the current jimtcl syntax. To allow compiling OpenOCD master branch with older versions of jimtcl, detect the version of jimtcl and use the appropriate syntax. Change-Id: I6fc78303b6a4db064a97f326c46119f4568e88f3 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reported-by: dullfire@yahoo.com Reviewed-on: https://review.openocd.org/c/openocd/+/6948 Tested-by: jenkins
-rw-r--r--src/target/target.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/target/target.c b/src/target/target.c
index 690526e..d2dff11 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -5222,10 +5222,18 @@ static int target_jim_set_reg(Jim_Interp *interp, int argc,
}
int tmp;
+#if JIM_VERSION >= 80
Jim_Obj **dict = Jim_DictPairs(interp, argv[1], &tmp);
if (!dict)
return JIM_ERR;
+#else
+ Jim_Obj **dict;
+ int ret = Jim_DictPairs(interp, argv[1], &dict, &tmp);
+
+ if (ret != JIM_OK)
+ return ret;
+#endif
const unsigned int length = tmp;
struct command_context *cmd_ctx = current_command_context(interp);