Commit 87fc2f4f authored by Colin Watson's avatar Colin Watson

Port to Tcl/Tk 8.6.

parent 37565aba
......@@ -240,9 +240,9 @@ AC_LIBOBJ([tcl])
dnl GNU/Linux Tcl requires -ldl
AC_CHECK_LIB(dl,dlopen)
LIBS="$LIBS -lm"
AC_SEARCH_LIBS(Tcl_Init,tcl tcl85 tcl8.5 tcl84 tcl8.4 tcl83 tcl8.3 tcl82 tcl8.2 tcl80 tcl8.0,,dnl
AC_SEARCH_LIBS(Tcl_Init,tcl tcl86 tcl8.6 tcl85 tcl8.5 tcl84 tcl8.4 tcl83 tcl8.3 tcl82 tcl8.2 tcl80 tcl8.0,,dnl
AC_MSG_ERROR([Tcl is required for Vigor but could not be located.]))
AC_SEARCH_LIBS(Tk_Init,tk tk85 tk8.5 tk84 tk8.4 tk83 tk8.3 tk82 tk8.2 tk80 tk8.0,,dnl
AC_SEARCH_LIBS(Tk_Init,tk tk86 tk8.6 tk85 tk8.5 tk84 tk8.4 tk83 tk8.3 tk82 tk8.2 tk80 tk8.0,,dnl
AC_MSG_ERROR([Tk is required for Vigor but could not be located.]),$XLIBS)
LIBS="$LIBS $XLIBS -lm"
AC_DEFINE(HAVE_TCL_INTERP)
......
......@@ -5,6 +5,7 @@ vigor (0.016-21) UNRELEASED; urgency=low
care of that by default because vigor does not use automake.
* Drop build/configure part of tcl-versions.patch, obsoleted by
dh_autoreconf.
* Port to Tcl/Tk 8.6.
-- Colin Watson <cjwatson@debian.org> Fri, 21 Dec 2012 11:24:31 +0000
......
......@@ -2,7 +2,7 @@ Source: vigor
Section: editors
Priority: extra
Maintainer: Colin Watson <cjwatson@debian.org>
Build-Depends: dpkg-dev (>= 1.16.1~), debhelper (>= 9~), dh-autoreconf, autotools-dev, libncurses5-dev, tcl8.5-dev, tk8.5-dev, libx11-dev, libxt-dev
Build-Depends: dpkg-dev (>= 1.16.1~), debhelper (>= 9~), dh-autoreconf, autotools-dev, libncurses5-dev, tcl8.6-dev, tk8.6-dev, libx11-dev, libxt-dev
Standards-Version: 3.5.7
Vcs-Bzr: http://anonscm.debian.org/bzr/users/cjwatson/vigor/trunk
......
......@@ -4,3 +4,4 @@ no-autotools-rebuild.patch
client-side-fonts.patch
modern-autotools.patch
out-of-tree.patch
tcl-interp-result.patch
Description: Tcl 8.6 disallows direct access to TclInterp.result
Author: Colin Watson <cjwatson@ubuntu.com>
Forwarded: no
Last-Update: 2012-12-21
Index: b/ex/ex_tcl.c
===================================================================
--- a/ex/ex_tcl.c
+++ b/ex/ex_tcl.c
@@ -71,7 +71,8 @@
Tcl_Eval(gp->tcl_interp, cmdp->argv[0]->bp) == TCL_OK)
return (0);
- msgq(sp, M_ERR, "Tcl: %s", ((Tcl_Interp *)gp->tcl_interp)->result);
+ msgq(sp, M_ERR, "Tcl: %s",
+ Tcl_GetStringResult((Tcl_Interp *)gp->tcl_interp));
return (1);
#else
msgq(sp, M_ERR, "302|Vi was not loaded with a Tcl interpreter");
Index: b/tcl_api/tcl.c
===================================================================
--- a/tcl_api/tcl.c
+++ b/tcl_api/tcl.c
@@ -64,6 +64,7 @@
char **argv;
{
SCR *sp;
+ char buf[20];
if (argc != 2) {
Tcl_SetResult(interp, "Usage: viFindScreen file", TCL_STATIC);
@@ -73,7 +74,8 @@
if (getscreenid(interp, &sp, NULL, argv[1]))
return (TCL_ERROR);
- (void)sprintf(interp->result, "%d", sp->id);
+ (void)snprintf(buf, sizeof(buf), "%d", sp->id);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
return (TCL_OK);
}
@@ -240,6 +242,7 @@
recno_t last;
void (*scr_msg) __P((SCR *, mtype_t, char *, size_t));
int rval;
+ char buf[40];
if (argc != 2) {
Tcl_SetResult(interp, "Usage: viLastLine screenId", TCL_STATIC);
@@ -254,7 +257,8 @@
if (rval)
return (TCL_ERROR);
- (void)sprintf(interp->result, "%lu", (unsigned long)last);
+ (void)snprintf(buf, sizeof(buf), "%lu", (unsigned long)last);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
return (TCL_OK);
}
@@ -504,6 +508,7 @@
SCR *sp, *nsp;
void (*scr_msg) __P((SCR *, mtype_t, char *, size_t));
int rval;
+ char buf[20];
if (argc != 2 && argc != 3) {
Tcl_SetResult(interp,
@@ -520,7 +525,8 @@
if (rval)
return (TCL_ERROR);
- (void)sprintf(interp->result, "%d", nsp->id);
+ (void)snprintf(buf, sizeof(buf), "%d", nsp->id);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
return (TCL_OK);
}
Index: b/tk/tk_main.c
===================================================================
--- a/tk/tk_main.c
+++ b/tk/tk_main.c
@@ -306,8 +306,11 @@
tcl_err(tkp)
TK_PRIVATE *tkp;
{
- (void)fprintf(stderr, "%s\n", tkp->interp->result != NULL ?
- tkp->interp->result : "Tcl/Tk: initialization error");
+ const char *result;
+
+ result = Tcl_GetStringResult(tkp->interp);
+ (void)fprintf(stderr, "%s\n", result != NULL ?
+ result : "Tcl/Tk: initialization error");
(void)tk_usage();
exit (1);
}
Index: b/vigor/vigor.c
===================================================================
--- a/vigor/vigor.c
+++ b/vigor/vigor.c
@@ -78,7 +78,7 @@
* to want tk's main window cluttering up the place. I should
* use a wm_withdraw instead. */
if (Tk_Init(vigor_interp) == TCL_ERROR) {
- fprintf(stderr, "%s\n", vigor_interp->result);
+ fprintf(stderr, "%s\n", Tcl_GetStringResult(vigor_interp));
return (1);
}
@@ -87,7 +87,7 @@
return (1);
#endif
if (Tcl_Eval(vigor_interp, vigor_tcl) == TCL_ERROR) {
- fprintf(stderr, "%s\n", vigor_interp->result);
+ fprintf(stderr, "%s\n", Tcl_GetStringResult(vigor_interp));
return (1);
}
@@ -127,7 +127,7 @@
init_vigor_phrases();
if (Tcl_Eval(vigor_interp, "vigor_init") == TCL_ERROR) {
- fprintf(stderr, "%s\n", vigor_interp->result);
+ fprintf(stderr, "%s\n", Tcl_GetStringResult(vigor_interp));
return (1);
}
......@@ -12,10 +12,10 @@ Index: b/build/configure.in
AC_CHECK_LIB(dl,dlopen)
LIBS="$LIBS -lm"
-AC_SEARCH_LIBS(Tcl_Init,tcl tcl82 tcl8.2 tcl80 tcl8.0,,dnl
+AC_SEARCH_LIBS(Tcl_Init,tcl tcl85 tcl8.5 tcl84 tcl8.4 tcl83 tcl8.3 tcl82 tcl8.2 tcl80 tcl8.0,,dnl
+AC_SEARCH_LIBS(Tcl_Init,tcl tcl86 tcl8.6 tcl85 tcl8.5 tcl84 tcl8.4 tcl83 tcl8.3 tcl82 tcl8.2 tcl80 tcl8.0,,dnl
AC_MSG_ERROR([Tcl is required for Vigor but could not be located.]))
-AC_SEARCH_LIBS(Tk_Init,tk tk82 tk8.2 tk80 tk8.0,,dnl
+AC_SEARCH_LIBS(Tk_Init,tk tk85 tk8.5 tk84 tk8.4 tk83 tk8.3 tk82 tk8.2 tk80 tk8.0,,dnl
+AC_SEARCH_LIBS(Tk_Init,tk tk86 tk8.6 tk85 tk8.5 tk84 tk8.4 tk83 tk8.3 tk82 tk8.2 tk80 tk8.0,,dnl
AC_MSG_ERROR([Tk is required for Vigor but could not be located.]),$XLIBS)
LIBS="$LIBS $XLIBS -lm"
AC_DEFINE(HAVE_TCL_INTERP)
......@@ -3,7 +3,7 @@
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export DEB_CPPFLAGS_MAINT_APPEND := -I/usr/include/tcl8.5
export DEB_CPPFLAGS_MAINT_APPEND := -I/usr/include/tcl8.6
%:
dh $@ --sourcedirectory=build --builddirectory=debian/build \
......
......@@ -71,7 +71,8 @@ ex_tcl(sp, cmdp)
Tcl_Eval(gp->tcl_interp, cmdp->argv[0]->bp) == TCL_OK)
return (0);
msgq(sp, M_ERR, "Tcl: %s", ((Tcl_Interp *)gp->tcl_interp)->result);
msgq(sp, M_ERR, "Tcl: %s",
Tcl_GetStringResult((Tcl_Interp *)gp->tcl_interp));
return (1);
#else
msgq(sp, M_ERR, "302|Vi was not loaded with a Tcl interpreter");
......
......@@ -64,6 +64,7 @@ tcl_fscreen(clientData, interp, argc, argv)
char **argv;
{
SCR *sp;
char buf[20];
if (argc != 2) {
Tcl_SetResult(interp, "Usage: viFindScreen file", TCL_STATIC);
......@@ -73,7 +74,8 @@ tcl_fscreen(clientData, interp, argc, argv)
if (getscreenid(interp, &sp, NULL, argv[1]))
return (TCL_ERROR);
(void)sprintf(interp->result, "%d", sp->id);
(void)snprintf(buf, sizeof(buf), "%d", sp->id);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
return (TCL_OK);
}
......@@ -240,6 +242,7 @@ tcl_lline(clientData, interp, argc, argv)
recno_t last;
void (*scr_msg) __P((SCR *, mtype_t, char *, size_t));
int rval;
char buf[40];
if (argc != 2) {
Tcl_SetResult(interp, "Usage: viLastLine screenId", TCL_STATIC);
......@@ -254,7 +257,8 @@ tcl_lline(clientData, interp, argc, argv)
if (rval)
return (TCL_ERROR);
(void)sprintf(interp->result, "%lu", (unsigned long)last);
(void)snprintf(buf, sizeof(buf), "%lu", (unsigned long)last);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
return (TCL_OK);
}
......@@ -504,6 +508,7 @@ tcl_iscreen(clientData, interp, argc, argv)
SCR *sp, *nsp;
void (*scr_msg) __P((SCR *, mtype_t, char *, size_t));
int rval;
char buf[20];
if (argc != 2 && argc != 3) {
Tcl_SetResult(interp,
......@@ -520,7 +525,8 @@ tcl_iscreen(clientData, interp, argc, argv)
if (rval)
return (TCL_ERROR);
(void)sprintf(interp->result, "%d", nsp->id);
(void)snprintf(buf, sizeof(buf), "%d", nsp->id);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
return (TCL_OK);
}
......
......@@ -306,8 +306,11 @@ static void
tcl_err(tkp)
TK_PRIVATE *tkp;
{
(void)fprintf(stderr, "%s\n", tkp->interp->result != NULL ?
tkp->interp->result : "Tcl/Tk: initialization error");
const char *result;
result = Tcl_GetStringResult(tkp->interp);
(void)fprintf(stderr, "%s\n", result != NULL ?
result : "Tcl/Tk: initialization error");
(void)tk_usage();
exit (1);
}
......
......@@ -78,7 +78,7 @@ vigor_init(gp)
* to want tk's main window cluttering up the place. I should
* use a wm_withdraw instead. */
if (Tk_Init(vigor_interp) == TCL_ERROR) {
fprintf(stderr, "%s\n", vigor_interp->result);
fprintf(stderr, "%s\n", Tcl_GetStringResult(vigor_interp));
return (1);
}
......@@ -87,7 +87,7 @@ vigor_init(gp)
return (1);
#endif
if (Tcl_Eval(vigor_interp, vigor_tcl) == TCL_ERROR) {
fprintf(stderr, "%s\n", vigor_interp->result);
fprintf(stderr, "%s\n", Tcl_GetStringResult(vigor_interp));
return (1);
}
......@@ -127,7 +127,7 @@ vigor_init(gp)
init_vigor_phrases();
if (Tcl_Eval(vigor_interp, "vigor_init") == TCL_ERROR) {
fprintf(stderr, "%s\n", vigor_interp->result);
fprintf(stderr, "%s\n", Tcl_GetStringResult(vigor_interp));
return (1);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment