summaryrefslogtreecommitdiffstats
path: root/unix/dltest
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-01-02 14:12:40 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-01-02 14:12:40 (GMT)
commitd51a3b0e2cbc83b69e055dfaf9b8d9faa74fec70 (patch)
tree2b5a59fc0d48eff7103f75b54f5c660bad219076 /unix/dltest
parent20253b8c7d3f3c59314380703be48df859cdf9e6 (diff)
downloadtcl-d51a3b0e2cbc83b69e055dfaf9b8d9faa74fec70.zip
tcl-d51a3b0e2cbc83b69e055dfaf9b8d9faa74fec70.tar.gz
tcl-d51a3b0e2cbc83b69e055dfaf9b8d9faa74fec70.tar.bz2
test Tcl_GetErrorLine() forwards/backwards compatibility in pkgb.so as well
Diffstat (limited to 'unix/dltest')
-rw-r--r--unix/dltest/pkgb.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/unix/dltest/pkgb.c b/unix/dltest/pkgb.c
index 0bff98b..99f189f 100644
--- a/unix/dltest/pkgb.c
+++ b/unix/dltest/pkgb.c
@@ -39,6 +39,10 @@ static int Pkgb_UnsafeObjCmd _ANSI_ARGS_((ClientData clientData,
*----------------------------------------------------------------------
*/
+#ifndef Tcl_GetErrorLine
+# define Tcl_GetErrorLine(interp) ((interp)->errorLine)
+#endif
+
static int
Pkgb_SubObjCmd(dummy, interp, objc, objv)
ClientData dummy; /* Not used. */
@@ -54,6 +58,9 @@ Pkgb_SubObjCmd(dummy, interp, objc, objv)
}
if ((Tcl_GetIntFromObj(interp, objv[1], &first) != TCL_OK)
|| (Tcl_GetIntFromObj(interp, objv[2], &second) != TCL_OK)) {
+ char buf[TCL_INTEGER_SPACE];
+ sprintf(buf, "%d", Tcl_GetErrorLine(interp));
+ Tcl_AppendResult(interp, " in line: ", buf, NULL);
return TCL_ERROR;
}
Tcl_SetObjResult(interp, Tcl_NewIntObj(first - second));