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
Jim_Obj **dict = Jim_DictPairs(interp, argv[1], &tmp);
if (!dict)
return JIM_ERR;
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);
const unsigned int length = tmp;
struct command_context *cmd_ctx = current_command_context(interp);