From 3864bf9fbdeb79617a10794182ab0ac014121acb Mon Sep 17 00:00:00 2001 From: dvrsn <> Date: Thu, 24 Dec 2009 19:50:08 +0000 Subject: [PATCH] fixes for tcl8.6 compatibility --- include/nsthread.h | 10 +++++++++- nsd/adpeval.c | 4 ++-- nsd/tclloop.c | 8 ++++---- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/include/nsthread.h b/include/nsthread.h index 6cbf4e2..6ad46d4 100644 --- a/include/nsthread.h +++ b/include/nsthread.h @@ -32,7 +32,7 @@ * * Core threading and system headers. * - * $Header: /Users/dossy/Desktop/cvs/aolserver/include/nsthread.h,v 1.31 2005/08/23 21:41:31 jgdavidson Exp $ + * $Header: /Users/dossy/Desktop/cvs/aolserver/include/nsthread.h,v 1.32 2009/12/24 19:50:06 dvrsn Exp $ */ #ifndef NSTHREAD_H @@ -418,4 +418,12 @@ NS_EXTERN char *Ns_ThreadStrCopy(char *old); #endif /* NS_NOCOMPAT */ +/* + * tcl 8.6 and TIP 330/336 compatability + */ + +#if (TCL_MAJOR_VERSION < 8) || (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 6) +#define Tcl_GetErrorLine(interp) (interp->errorLine) +#endif + #endif /* NSTHREAD_H */ diff --git a/nsd/adpeval.c b/nsd/adpeval.c index cba1e16..39b8e57 100644 --- a/nsd/adpeval.c +++ b/nsd/adpeval.c @@ -33,7 +33,7 @@ * ADP string and file eval. */ -static const char *RCSID = "@(#) $Header: /Users/dossy/Desktop/cvs/aolserver/nsd/adpeval.c,v 1.49 2006/06/28 17:41:06 shmooved Exp $, compiled: " __DATE__ " " __TIME__; +static const char *RCSID = "@(#) $Header: /Users/dossy/Desktop/cvs/aolserver/nsd/adpeval.c,v 1.50 2009/12/24 19:50:07 dvrsn Exp $, compiled: " __DATE__ " " __TIME__; #include "nsd.h" @@ -836,7 +836,7 @@ NsAdpLogError(NsInterp *itPtr) if (framePtr != NULL) { Ns_DStringPrintf(&ds, "\n at line %d of ", - framePtr->line + interp->errorLine); + framePtr->line + Tcl_GetErrorLine(interp)); } inc = ""; while (framePtr != NULL) { diff --git a/nsd/tclloop.c b/nsd/tclloop.c index 27fb41d..5df7084 100644 --- a/nsd/tclloop.c +++ b/nsd/tclloop.c @@ -34,7 +34,7 @@ * monitored and managed by "ns_loop_ctl" command. */ -static const char *RCSID = "@(#) $Header: /Users/dossy/Desktop/cvs/aolserver/nsd/tclloop.c,v 1.3 2008/06/20 08:06:32 gneumann Exp $, compiled: " __DATE__ " " __TIME__; +static const char *RCSID = "@(#) $Header: /Users/dossy/Desktop/cvs/aolserver/nsd/tclloop.c,v 1.4 2009/12/24 19:50:08 dvrsn Exp $, compiled: " __DATE__ " " __TIME__; #include "nsd.h" @@ -157,7 +157,7 @@ NsTclForObjCmd(arg, interp, objc, objv) if (result == TCL_ERROR) { char msg[32 + TCL_INTEGER_SPACE]; - sprintf(msg, "\n (\"for\" body line %d)",interp->errorLine); + sprintf(msg, "\n (\"for\" body line %d)",Tcl_GetErrorLine(interp)); Tcl_AddErrorInfo(interp, msg); } break; @@ -242,7 +242,7 @@ NsTclWhileObjCmd(arg, interp, objc, objv) char msg[32 + TCL_INTEGER_SPACE]; sprintf(msg, "\n (\"while\" body line %d)", - interp->errorLine); + Tcl_GetErrorLine(interp)); Tcl_AddErrorInfo(interp, msg); } break; @@ -460,7 +460,7 @@ NsTclForeachObjCmd(arg, interp, objc, objv) char msg[32 + TCL_INTEGER_SPACE]; sprintf(msg, "\n (\"foreach\" body line %d)", - interp->errorLine); + Tcl_GetErrorLine(interp)); Tcl_AddObjErrorInfo(interp, msg, -1); break; } else {