Skip to content

Commit 76290b7

Browse files
author
jan.nijtmans
committed
Merge trunk. Make it work with Tcl 8.6 (again)
2 parents be2f521 + c157b89 commit 76290b7

File tree

14 files changed

+129
-50
lines changed

14 files changed

+129
-50
lines changed

.github/workflows/linux-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ defaults:
55
shell: bash
66
jobs:
77
build:
8-
runs-on: ubuntu-22.04
8+
runs-on: ubuntu-24.04
99
strategy:
1010
matrix:
1111
compiler:

configure

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2872,16 +2872,16 @@ printf "%s\n" "$as_me: WARNING: --with-tcl argument should refer to directory co
28722872
`ls -d /usr/pkg/lib 2>/dev/null` \
28732873
`ls -d /usr/lib 2>/dev/null` \
28742874
`ls -d /usr/lib64 2>/dev/null` \
2875+
`ls -d /usr/lib/tcl9.1 2>/dev/null` \
28752876
`ls -d /usr/lib/tcl9.0 2>/dev/null` \
2876-
`ls -d /usr/lib/tcl8.7 2>/dev/null` \
28772877
`ls -d /usr/lib/tcl8.6 2>/dev/null` \
28782878
`ls -d /usr/lib/tcl8.5 2>/dev/null` \
2879+
`ls -d /usr/local/lib/tcl9.1 2>/dev/null` \
28792880
`ls -d /usr/local/lib/tcl9.0 2>/dev/null` \
2880-
`ls -d /usr/local/lib/tcl8.7 2>/dev/null` \
28812881
`ls -d /usr/local/lib/tcl8.6 2>/dev/null` \
28822882
`ls -d /usr/local/lib/tcl8.5 2>/dev/null` \
2883+
`ls -d /usr/local/lib/tcl/tcl9.1 2>/dev/null` \
28832884
`ls -d /usr/local/lib/tcl/tcl9.0 2>/dev/null` \
2884-
`ls -d /usr/local/lib/tcl/tcl8.7 2>/dev/null` \
28852885
`ls -d /usr/local/lib/tcl/tcl8.6 2>/dev/null` \
28862886
`ls -d /usr/local/lib/tcl/tcl8.5 2>/dev/null` \
28872887
; do
@@ -2926,11 +2926,6 @@ printf "%s\n" "found ${TCL_BIN_DIR}/tclConfig.sh" >&6; }
29262926
fi
29272927
fi
29282928

2929-
if test x"${with_tcl8}" != x; then
2930-
with_tcl8=""
2931-
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: --with-tcl8 option ignored" >&5
2932-
printf "%s\n" "$as_me: WARNING: --with-tcl8 option ignored" >&2;}
2933-
fi
29342929

29352930

29362931

@@ -4116,9 +4111,19 @@ printf "%s\n" "#define BUILD_${PACKAGE_NAME} /**/" >>confdefs.h
41164111

41174112

41184113

4119-
if test "${TCL_MAJOR_VERSION}" -eq 8; then
4120-
as_fn_error $? "${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 9.0+
4121-
Found config for Tcl ${TCL_VERSION}" "$LINENO" 5
4114+
#--------------------------------------------------------------------
4115+
# Tcl 8.6+ required.
4116+
#--------------------------------------------------------------------
4117+
4118+
if test "${TCL_MAJOR_VERSION}" -lt 8; then
4119+
as_fn_error $? "${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}.
4120+
Itcl ${PACKAGE_VERSION} needs Tcl 8.6 or higher.
4121+
Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6+." "$LINENO" 5
4122+
fi
4123+
if test "${TCL_MINOR_VERSION}" -lt 6 -a "${TCL_MAJOR_VERSION}" -eq 8; then
4124+
as_fn_error $? "${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}.
4125+
Itcl ${PACKAGE_VERSION} needs Tcl 8.6 or higher.
4126+
Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6+." "$LINENO" 5
41224127
fi
41234128

41244129
#--------------------------------------------------------------------

configure.ac

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ dnl to configure the system for the local environment.
1515
# This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION
1616
# set as provided. These will also be added as -D defs in your Makefile
1717
# so you can encode the package version directly into the source files.
18+
# This will also define a special symbol for Windows (BUILD_<PACKAGE_NAME>
19+
# so that we create the export library with the dll.
1820
#-----------------------------------------------------------------------
1921

2022
AC_INIT([itcl],[4.4a0])
@@ -55,15 +57,21 @@ AC_CONFIG_AUX_DIR(tclconfig)
5557
#--------------------------------------------------------------------
5658

5759
TEA_PATH_TCLCONFIG
58-
if test x"${with_tcl8}" != x; then
59-
with_tcl8=""
60-
AC_MSG_WARN([--with-tcl8 option ignored])
61-
fi
6260
TEA_LOAD_TCLCONFIG
6361

64-
if test "${TCL_MAJOR_VERSION}" -eq 8; then
65-
AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 9.0+
66-
Found config for Tcl ${TCL_VERSION}])
62+
#--------------------------------------------------------------------
63+
# Tcl 8.6+ required.
64+
#--------------------------------------------------------------------
65+
66+
if test "${TCL_MAJOR_VERSION}" -lt 8; then
67+
AC_MSG_ERROR([${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}.
68+
Itcl ${PACKAGE_VERSION} needs Tcl 8.6 or higher.
69+
Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6+.])
70+
fi
71+
if test "${TCL_MINOR_VERSION}" -lt 6 -a "${TCL_MAJOR_VERSION}" -eq 8; then
72+
AC_MSG_ERROR([${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}.
73+
Itcl ${PACKAGE_VERSION} needs Tcl 8.6 or higher.
74+
Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6+.])
6775
fi
6876

6977
#--------------------------------------------------------------------

generic/itcl.h

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757

5858
#include <tcl.h>
5959

60-
#if (TCL_MAJOR_VERSION < 9)
61-
# error Itcl 4 build requires tcl.h from Tcl 9.0 or later
60+
#if (TCL_MAJOR_VERSION == 8) && defined(TCL_MINOR_VERSION) && (TCL_MINOR_VERSION < 6)
61+
# error Itcl 4 build requires tcl.h from Tcl 8.6 or later
6262
#endif
6363

6464
/*
@@ -69,16 +69,6 @@
6969
extern "C" {
7070
#endif
7171

72-
#ifndef TCL_ALPHA_RELEASE
73-
# define TCL_ALPHA_RELEASE 0
74-
#endif
75-
#ifndef TCL_BETA_RELEASE
76-
# define TCL_BETA_RELEASE 1
77-
#endif
78-
#ifndef TCL_FINAL_RELEASE
79-
# define TCL_FINAL_RELEASE 2
80-
#endif
81-
8272
#define ITCL_MAJOR_VERSION 4
8373
#define ITCL_MINOR_VERSION 4
8474
#define ITCL_RELEASE_LEVEL TCL_ALPHA_RELEASE
@@ -132,6 +122,10 @@ ITCL_EXTERN int Itcl_SafeInit(Tcl_Interp *interp);
132122
#define ITCL_PRIVATE 3
133123
#define ITCL_DEFAULT_PROTECT 4
134124

125+
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 7) && !defined(Tcl_Size)
126+
# define Tcl_Size int
127+
#endif
128+
135129
/*
136130
* Generic stack.
137131
*/

generic/itclBase.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ static Tcl_NamespaceDeleteProc FreeItclObjectInfo;
1818
static Tcl_ObjCmdProc2 ItclSetHullWindowName;
1919
static Tcl_ObjCmdProc2 ItclCheckSetItclHull;
2020

21+
#if TCL_MAJOR_VERSION < 9
22+
# define objProc2 objProc
23+
#endif
24+
2125
MODULE_SCOPE const ItclStubs itclStubs;
2226

2327
static int Initialize(Tcl_Interp *interp);

generic/itclDecls.h

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,38 @@ ITCLAPI const char *Itcl_InitStubs(
1515

1616
#endif
1717

18-
#ifdef TCL_NO_DEPRECATED
18+
#if (TCL_MAJOR_VERSION < 9)
19+
# if !defined(Tcl_ObjCmdProc2)
20+
# define Tcl_ObjCmdProc2 Tcl_ObjCmdProc
21+
# endif
22+
# if !defined(Tcl_MethodType2)
23+
# define Tcl_MethodType2 Tcl_MethodType
24+
# endif
25+
# if !defined(Tcl_MethodCallProc2)
26+
# define Tcl_MethodCallProc2 Tcl_MethodCallProc
27+
# endif
28+
# if !defined(Tcl_NewMethod2)
29+
# define Tcl_NewMethod2 Tcl_NewMethod
30+
# endif
31+
# if !defined(Tcl_CreateObjCommand2)
32+
# define Tcl_CreateObjCommand2 Tcl_CreateObjCommand
33+
# endif
34+
# if !defined(Tcl_NRCreateCommand2)
35+
# define Tcl_NRCreateCommand2 Tcl_NRCreateCommand
36+
# endif
37+
# if !defined(Tcl_NRCallObjProc2)
38+
# define Tcl_NRCallObjProc2 Tcl_NRCallObjProc
39+
# endif
40+
# if !defined(Tcl_NewInstanceMethod2)
41+
# define Tcl_NewInstanceMethod2 Tcl_NewInstanceMethod
42+
# endif
43+
# if !defined(TclGetObjInterpProc2)
44+
# define TclGetObjInterpProc2 TclGetObjInterpProc
45+
# endif
46+
# if !defined(TCL_OO_METHOD_VERSION_2)
47+
# define TCL_OO_METHOD_VERSION_2 TCL_OO_METHOD_VERSION_CURRENT
48+
# endif
49+
#elif defined(TCL_NO_DEPRECATED)
1950
# define Tcl_ObjCmdProc void
2051
# define Tcl_CmdProc void
2152
#endif
@@ -216,12 +247,18 @@ extern const ItclStubs *itclStubsPtr;
216247

217248
/* !END!: Do not edit above this line. */
218249

219-
#ifdef TCL_NO_DEPRECATED
220-
# undef Tcl_ObjCmdProc
221-
# undef Tcl_CmdProc
222-
# undef Itcl_RegisterC
223-
# undef Itcl_RegisterObjC
224-
# undef Itcl_FindC
250+
#if (TCL_MAJOR_VERSION < 9)
251+
# undef Itcl_RegisterObjC2
252+
# define Itcl_RegisterObjC2 Itcl_RegisterObjC
253+
# undef Itcl_FindC2
254+
# define Itcl_FindC2(interp, name, objProcPtr, cDataPtr) \
255+
Itcl_FindC(interp, name, NULL, objProcPtr, cDataPtr)
256+
#elif defined(TCL_NO_DEPRECATED)
257+
# undef Tcl_ObjCmdProc
258+
# undef Tcl_CmdProc
259+
# undef Itcl_RegisterC
260+
# undef Itcl_RegisterObjC
261+
# undef Itcl_FindC
225262
#endif
226263

227264
#endif /* _ITCLDECLS */

generic/itclEnsemble.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
#define ITCL_ENSEMBLE_CUSTOM 0x01
3636
#define ITCL_ENSEMBLE_ENSEMBLE 0x02
3737

38+
#if TCL_MAJOR_VERSION < 9
39+
# define objClientData2 objClientData
40+
#endif
41+
3842
/*
3943
* Data used to represent an ensemble:
4044
*/

generic/itclHelpers.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
#include "itclInt.h"
1414

1515
void ItclDeleteArgList(ItclArgList *arglistPtr);
16+
17+
#if TCL_MAJOR_VERSION < 9
18+
# define objProc2 objProc
19+
# define objClientData2 objClientData
20+
#endif
21+
1622
#ifdef ITCL_DEBUG
1723
int _itcl_debug_level = 0;
1824

generic/itclInfo.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ static Tcl_ObjCmdProc2 Itcl_BiInfoDelegatedTypeMethodCmd;
5959
static Tcl_ObjCmdProc2 Itcl_BiInfoDelegatedUnknownCmd;
6060
static Tcl_ObjCmdProc2 Itcl_BiInfoContextCmd;
6161

62+
#if TCL_MAJOR_VERSION < 9
63+
# define objProc2 objProc
64+
# define objClientData2 objClientData
65+
#endif
66+
6267
typedef struct InfoMethod {
6368
const char* name; /* method name */
6469
const char* usage; /* string describing usage */

generic/itclInt.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@
8080
# endif
8181
#endif
8282

83+
#if TCL_MAJOR_VERSION == 8 && defined(TCL_MINOR_VERSION) && TCL_MINOR_VERSION < 7
84+
# define TCL_SIZE_MODIFIER ""
85+
#endif
86+
8387
/*
8488
* Since the Tcl/Tk distribution doesn't perform any asserts,
8589
* dynamic loading can fail to find the __assert function.
@@ -608,6 +612,9 @@ typedef struct ItclMethodVariable {
608612
typedef struct ItclClassCmdInfo {
609613
int type;
610614
int protection;
615+
#if TCL_MAJOR_VERSION == 8
616+
int cmdNum; /* not actually used */
617+
#endif
611618
Tcl_Namespace *nsPtr;
612619
Tcl_Namespace *declaringNsPtr;
613620
} ItclClassCmdInfo;
@@ -633,6 +640,9 @@ typedef struct ItclVarLookup {
633640
*/
634641
typedef struct ItclCmdLookup {
635642
ItclMemberFunc* imPtr; /* function definition */
643+
#if TCL_MAJOR_VERSION == 8
644+
int cmdNum; /* not actually used */
645+
#endif
636646
ItclClassCmdInfo *classCmdInfoPtr;
637647
Tcl_Command cmdPtr;
638648
} ItclCmdLookup;

0 commit comments

Comments
 (0)