Skip to content

Commit 6ba89e7

Browse files
author
jan.nijtmans
committed
Fix [a3a3228c00]: Build failure with non-stubs Tcl 8.6
1 parent 4ebd56d commit 6ba89e7

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

generic/tclThreadInt.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,16 @@
6363
# endif
6464
#endif
6565

66-
#if (TCL_MAJOR_VERSION == 8) && defined(USE_TCL_STUBS)
66+
#if (TCL_MAJOR_VERSION == 8)
6767
#undef Tcl_Free
68-
#define Tcl_Free(p) tclStubsPtr->tcl_Free((char *)(p))
6968
#undef Tcl_Realloc
70-
#define Tcl_Realloc(p,m) tclStubsPtr->tcl_Realloc((char *)(p),(m))
69+
#if defined(USE_TCL_STUBS)
70+
# define Tcl_Free(p) tclStubsPtr->tcl_Free((char *)(p))
71+
# define Tcl_Realloc(p,m) tclStubsPtr->tcl_Realloc((char *)(p),(m))
72+
#else
73+
# define Tcl_Free(p) Tcl_Free((char *)(p))
74+
# define Tcl_Realloc(p,m) Tcl_Realloc((char *)(p),(m))
75+
#endif
7176
#endif
7277

7378
#ifndef JOIN

generic/threadSvListCmd.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
#include "threadSvListCmd.h"
1515

1616
/* Tcl 8 only defines Tcl_GetIntForIndex in its internal stubs */
17-
#if TCL_MAJOR_VERSION < 9 && defined(USE_TCL_STUBS)
17+
#if TCL_MAJOR_VERSION < 9
18+
# if defined(USE_TCL_STUBS)
1819
/* Little hack to eliminate the need for "tclInt.h" here:
1920
Just copy a small portion of TclIntStubs, just
2021
enough to make it work */
@@ -30,6 +31,10 @@ extern const TclIntStubs *tclIntStubsPtr;
3031
# define Tcl_GetIntForIndex(interp, obj, max, ptr) ((tclIntStubsPtr->tclGetIntForIndex == NULL)? \
3132
((int (*)(Tcl_Interp*, Tcl_Obj *, int, int*))(void *)((&(tclStubsPtr->tcl_PkgProvideEx))[645]))((interp), (obj), (max), (ptr)): \
3233
tclIntStubsPtr->tclGetIntForIndex((interp), (obj), (max), (ptr)))
34+
# else
35+
EXTERN int TclGetIntForIndex(Tcl_Interp *interp, Tcl_Obj *objPtr, int endValue, int *indexPtr);
36+
# define Tcl_GetIntForIndex TclGetIntForIndex
37+
# endif
3338
#endif
3439

3540
/*

0 commit comments

Comments
 (0)