Index: ChangeLog =================================================================== diff -u -ree73265e036871a0e6f5b83544ff0982c24864ed -r0e6f9ba5d9d7a8ce3e765f8a456a169f4b676b06 --- ChangeLog (.../ChangeLog) (revision ee73265e036871a0e6f5b83544ff0982c24864ed) +++ ChangeLog (.../ChangeLog) (revision 0e6f9ba5d9d7a8ce3e765f8a456a169f4b676b06) @@ -62,6 +62,11 @@ Meta C -superclass O -parameter {a {b -default ""} {c -default 1}} C c1 ;# c1 has no no default value for "a", before it had one ====== +2009-07-04 + - removed compatibility for versions before Tcl 8.4 (was not tested anyhow) + This version requires at least Tcl 8.4. + - from 15356 generic/xotcl.c => 13346 + 2009-07-01 - moved all definitions of method commands to generated code - separated C-code generator from declarations Index: generic/xotcl.c =================================================================== diff -u -r2252fd2633d5547530210a14fe47ff471b2cdbea -r0e6f9ba5d9d7a8ce3e765f8a456a169f4b676b06 --- generic/xotcl.c (.../xotcl.c) (revision 2252fd2633d5547530210a14fe47ff471b2cdbea) +++ generic/xotcl.c (.../xotcl.c) (revision 0e6f9ba5d9d7a8ce3e765f8a456a169f4b676b06) @@ -194,41 +194,6 @@ #endif - - -#ifdef PRE81 -/* for backward compatibility only - */ -static int -Tcl_EvalObjv(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], int flags) { - int i, result; - Tcl_DString ds, *dsp = &ds; - - assert(flags == 0); - DSTRING_INIT(dsp); - for (i = 0; i < objc; i++) { - Tcl_DStringAppendElement(dsp, ObjStr(objv[i])); - } - result = Tcl_Eval(interp, Tcl_DStringValue(dsp)); - DSTRING_FREE(dsp); - return result; -} -static int -Tcl_EvalEx(Tcl_Interp *interp, char *cmd, int len, int flags) { - return Tcl_Eval(interp, cmd); -} -static int -Tcl_SubstObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { - char *ov[20]; - int i; - assert(objc<19); - for (i=0; ics.top->cmdPtr);*/ return Tcl_GetCommandName(interp, CallStackGetFrame(interp)->cmdPtr); @@ -1045,19 +1010,11 @@ static Tcl_ObjType *tclCmdNameType = NULL; if (tclCmdNameType == NULL) { -# if defined(PRE82) - if (cmdType - && cmdType != &XOTclObjectType - && !strcmp(cmdType->name,"cmdName")) { - tclCmdNameType = cmdType; - } -# else static XOTclMutex initMutex = 0; XOTclMutexLock(&initMutex); if (tclCmdNameType == NULL) tclCmdNameType = Tcl_GetObjType("cmdName"); XOTclMutexUnlock(&initMutex); -# endif } return tclCmdNameType; } @@ -2262,11 +2219,7 @@ int valueLength, mustCopy = 1, format = 0; char *valueString, *c; Tcl_Obj *valueObject, *result = NULL, *savedResult = NULL; -#ifdef PRE83 - int flgs = 0; -#else int flgs = TCL_LEAVE_ERR_MSG; -#endif XOTcl_FrameDecls; XOTcl_PushFrame(interp, obj); @@ -2836,7 +2789,7 @@ CmdListFindNameInList(Tcl_Interp *interp, char *name, XOTclCmdList *l) { register XOTclCmdList *h; for (h = l; h; h = h->nextPtr) { - CONST84 char *cmdName = Tcl_GetCommandName(interp, h->cmdPtr); + CONST char *cmdName = Tcl_GetCommandName(interp, h->cmdPtr); if (cmdName[0] == name[0] && !strcmp(cmdName, name)) return h; } @@ -4464,7 +4417,7 @@ * with obj */ static Tcl_Obj * -getFullProcQualifier(Tcl_Interp *interp, CONST84 char *cmdName, +getFullProcQualifier(Tcl_Interp *interp, CONST char *cmdName, XOTclObject *obj, XOTclClass *cl, Tcl_Command cmd) { Tcl_Obj *list = Tcl_NewListObj(0, NULL); Tcl_Obj *procObj = Tcl_NewStringObj(cmdName, -1); @@ -4509,7 +4462,7 @@ static int FilterInfo(Tcl_Interp *interp, XOTclCmdList *f, char *pattern, int withGuards, int fullProcQualifiers) { - CONST84 char *simpleName; + CONST char *simpleName; Tcl_Obj *list = Tcl_NewListObj(0, NULL); /*fprintf(stderr,"FilterInfo %p %s %d %d\n", pattern, pattern, withGuards, fullProcQualifiers);*/ @@ -5030,16 +4983,11 @@ XOTcl_PushFrame(interp, obj); -#if defined(PRE83) - varPtr = TclLookupVar(interp, varName, index, flags, "access", - /*createPart1*/ 0, /*createPart2*/ 0, &arrayPtr); -#else if (triggerTrace) varPtr = TclVarTraceExists(interp, varName); else varPtr = TclLookupVar(interp, varName, index, flags, "access", /*createPart1*/ 0, /*createPart2*/ 0, &arrayPtr); -#endif /* fprintf(stderr, "varExists %s varPtr %p requireDefined %d, triggerTrace %d, isundef %d\n", varName, @@ -7239,7 +7187,7 @@ } static char * -XOTclUnsetTrace(ClientData clientData, Tcl_Interp *interp, CONST84 char *name, CONST84 char *name2, int flags) +XOTclUnsetTrace(ClientData clientData, Tcl_Interp *interp, CONST char *name, CONST char *name2, int flags) { Tcl_Obj *obj = (Tcl_Obj *)clientData; XOTclObject *o; @@ -9400,19 +9348,13 @@ be moved into the interpreter state */ if (listType == NULL) { -#if defined(PRE82) - Tcl_Obj *tmp = Tcl_NewListObj(1, &obj); - listType = tmp->typePtr; - DECR_REF_COUNT(tmp); -#else static XOTclMutex initMutex = 0; XOTclMutexLock(&initMutex); if (listType == NULL) { listType = Tcl_GetObjType("list"); /*fprintf(stderr, "fetching listType=%p\n", listType);*/ } XOTclMutexUnlock(&initMutex); -#endif } if (obj->typePtr == listType) { @@ -10638,7 +10580,7 @@ return TCL_OK; for (cmdList = obj->filterOrder; cmdList; cmdList = cmdList->nextPtr) { - CONST84 char *filterName = Tcl_GetCommandName(interp, cmdList->cmdPtr); + CONST char *filterName = Tcl_GetCommandName(interp, cmdList->cmdPtr); if (filterName[0] == filter[0] && !strcmp(filterName, filter)) break; } @@ -13064,10 +13006,8 @@ XOTcl_ThreadExitProc(ClientData clientData) { /*fprintf(stderr,"+++ XOTcl_ThreadExitProc\n");*/ -# if !defined(PRE83) void XOTcl_ExitProc(ClientData clientData); Tcl_DeleteExitHandler(XOTcl_ExitProc, clientData); -# endif ExitHandler(clientData); } #endif @@ -13078,7 +13018,7 @@ void XOTcl_ExitProc(ClientData clientData) { /*fprintf(stderr,"+++ XOTcl_ExitProc\n");*/ -#if !defined(PRE83) && defined(TCL_THREADS) +#if defined(TCL_THREADS) Tcl_DeleteThreadExitHandler(XOTcl_ThreadExitProc, clientData); #endif ExitHandler(clientData); @@ -13091,7 +13031,7 @@ static void RegisterExitHandlers(ClientData clientData) { Tcl_Preserve(clientData); -#if !defined(PRE83) && defined(TCL_THREADS) +#if defined(TCL_THREADS) Tcl_CreateThreadExitHandler(XOTcl_ThreadExitProc, clientData); #endif Tcl_CreateExitHandler(XOTcl_ExitProc, clientData); @@ -13164,12 +13104,10 @@ XOTclCompEnv *interpstructions = XOTclGetCompEnv(); #endif -#ifndef PRE81 -# ifdef USE_TCL_STUBS +#ifdef USE_TCL_STUBS if (Tcl_InitStubs(interp, "8.1", 0) == NULL) { return TCL_ERROR; } -# endif #endif #if defined(TCL_MEM_DEBUG) @@ -13386,7 +13324,7 @@ # endif #endif -#if !defined(TCL_THREADS) && !defined(PRE81) +#if !defined(TCL_THREADS) if ((Tcl_GetVar2(interp, "tcl_platform", "threaded", TCL_GLOBAL_ONLY) != NULL)) { /* a non threaded XOTcl version is loaded into a threaded environment */ fprintf(stderr, "\n A non threaded XOTCL version is loaded into threaded environment\n Please reconfigure XOTcl with --enable-threads!\n\n\n"); Index: generic/xotcl.h =================================================================== diff -u -r2252fd2633d5547530210a14fe47ff471b2cdbea -r0e6f9ba5d9d7a8ce3e765f8a456a169f4b676b06 --- generic/xotcl.h (.../xotcl.h) (revision 2252fd2633d5547530210a14fe47ff471b2cdbea) +++ generic/xotcl.h (.../xotcl.h) (revision 0e6f9ba5d9d7a8ce3e765f8a456a169f4b676b06) @@ -108,22 +108,6 @@ # error Tcl distribution is TOO OLD, we require at least tcl8.0 #endif -#if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION<1 -# define PRE81 -#else -# if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION==1 -# define V81 -# endif -#endif -#if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION<2 -# define PRE82 -#endif -#if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION<3 -# define PRE83 -#endif -#if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION<4 -# define PRE84 -#endif #if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION<5 # define PRE85 #endif Index: generic/xotclInt.h =================================================================== diff -u -rc990d14157d8434cd5b1ee5f45aa43f82cb911b5 -r0e6f9ba5d9d7a8ce3e765f8a456a169f4b676b06 --- generic/xotclInt.h (.../xotclInt.h) (revision c990d14157d8434cd5b1ee5f45aa43f82cb911b5) +++ generic/xotclInt.h (.../xotclInt.h) (revision 0e6f9ba5d9d7a8ce3e765f8a456a169f4b676b06) @@ -227,7 +227,7 @@ # endif #endif -#if !defined(PRE83) && defined(TCL_THREADS) +#if defined(TCL_THREADS) # define XOTclMutex Tcl_Mutex # define XOTclMutexLock(a) Tcl_MutexLock(a) # define XOTclMutexUnlock(a) Tcl_MutexUnlock(a) @@ -237,38 +237,8 @@ # define XOTclMutexUnlock(a) (*(a))-- #endif -#if defined(PRE84) -# define CONST84 -#else -# define CONST84 CONST -#endif +#define ObjStr(obj) (obj)->bytes ? (obj)->bytes : Tcl_GetString(obj) -#if defined(PRE81) -# define ObjStr(obj) Tcl_GetStringFromObj(obj, ((int*)NULL)) -#else -# define ObjStr(obj) (obj)->bytes ? (obj)->bytes : Tcl_GetString(obj) -/*# define ObjStr(obj) Tcl_GetString(obj) */ -#endif - -#ifdef V81 -# define EvalObj(interp,cmd) Tcl_EvalObj(interp, cmd, 0) -# define TclIsVarArgument(args) (args->isArg) -# define Tcl_ObjSetVar2(interp,p1,p2,newval,flags) \ - Tcl_SetObjVar2(interp,ObjStr(p1),p2,newval,flags) -#define Tcl_ObjGetVar2(interp,name1,name2,flgs) \ - Tcl_GetObjVar2(interp, ObjStr(name1), \ - ((name2==NULL) ? (char*)NULL : ObjStr(name2)), flgs) -#else -# if defined(PRE83) -# define EvalObj(interp, cmd) Tcl_EvalObj(interp,cmd) -# else -# define EvalObj(interp, cmd) Tcl_EvalObjEx(interp,cmd,0) -# endif -# if defined(PRE81) && TCL_RELEASE_SERIAL<3 -# define TclIsVarArgument(args) (args->isArg) -# endif -#endif - #if 0 #define XOTcl_FrameDecls CallFrame *oldFramePtr = 0, frame, *newFramePtr = &frame #define XOTcl_PushFrame(interp, obj) \