@@ -9,8 +9,8 @@ Copyright (C) 1994 Steen Lumholt.
9
9
10
10
/* TCL/TK VERSION INFO:
11
11
12
- Only Tcl/Tk 8.3.1 and later are supported. Older versions are not
13
- supported. Use Python 2.6 or older if you cannot upgrade your
12
+ Only Tcl/Tk 8.4 and later are supported. Older versions are not
13
+ supported. Use Python 3.4 or older if you cannot upgrade your
14
14
Tcl/Tk libraries.
15
15
*/
16
16
@@ -36,13 +36,6 @@ Copyright (C) 1994 Steen Lumholt.
36
36
#define CHECK_SIZE (size , elemsize ) \
37
37
((size_t)(size) <= Py_MAX((size_t)INT_MAX, UINT_MAX / (size_t)(elemsize)))
38
38
39
- /* Starting with Tcl 8.4, many APIs offer const-correctness. Unfortunately,
40
- making _tkinter correct for this API means to break earlier
41
- versions. USE_COMPAT_CONST allows to make _tkinter work with both 8.4 and
42
- earlier versions. Once Tcl releases before 8.4 don't need to be supported
43
- anymore, this should go. */
44
- #define USE_COMPAT_CONST
45
-
46
39
/* If Tcl is compiled for threads, we must also define TCL_THREAD. We define
47
40
it always; if Tcl is not threaded, the thread functions in
48
41
Tcl are empty. */
@@ -58,15 +51,8 @@ Copyright (C) 1994 Steen Lumholt.
58
51
59
52
#include "tkinter.h"
60
53
61
- /* For Tcl 8.2 and 8.3, CONST* is not defined (except on Cygwin). */
62
- #ifndef CONST84_RETURN
63
- #define CONST84_RETURN
64
- #undef CONST
65
- #define CONST
66
- #endif
67
-
68
- #if TK_VERSION_HEX < 0x08030102
69
- #error "Tk older than 8.3.1 not supported"
54
+ #if TK_VERSION_HEX < 0x08040002
55
+ #error "Tk older than 8.4 not supported"
70
56
#endif
71
57
72
58
#if !(defined(MS_WINDOWS ) || defined(__CYGWIN__ ))
@@ -376,10 +362,10 @@ unicodeFromTclObj(Tcl_Obj *value)
376
362
377
363
378
364
static PyObject *
379
- Split (char * list )
365
+ Split (const char * list )
380
366
{
381
367
int argc ;
382
- char * * argv ;
368
+ const char * * argv ;
383
369
PyObject * v ;
384
370
385
371
if (list == NULL ) {
@@ -481,7 +467,7 @@ SplitObj(PyObject *arg)
481
467
}
482
468
else if (PyUnicode_Check (arg )) {
483
469
int argc ;
484
- char * * argv ;
470
+ const char * * argv ;
485
471
char * list = PyUnicode_AsUTF8 (arg );
486
472
487
473
if (list == NULL ||
@@ -496,7 +482,7 @@ SplitObj(PyObject *arg)
496
482
}
497
483
else if (PyBytes_Check (arg )) {
498
484
int argc ;
499
- char * * argv ;
485
+ const char * * argv ;
500
486
char * list = PyBytes_AsString (arg );
501
487
502
488
if (Tcl_SplitList ((Tcl_Interp * )NULL , list , & argc , & argv ) != TCL_OK ) {
@@ -563,8 +549,9 @@ static void EnableEventHook(void); /* Forward */
563
549
static void DisableEventHook (void ); /* Forward */
564
550
565
551
static TkappObject *
566
- Tkapp_New (char * screenName , char * className ,
567
- int interactive , int wantobjects , int wantTk , int sync , char * use )
552
+ Tkapp_New (const char * screenName , const char * className ,
553
+ int interactive , int wantobjects , int wantTk , int sync ,
554
+ const char * use )
568
555
{
569
556
TkappObject * v ;
570
557
char * argv0 ;
@@ -1857,7 +1844,7 @@ Tkapp_SplitList(PyObject *self, PyObject *args)
1857
1844
{
1858
1845
char * list ;
1859
1846
int argc ;
1860
- char * * argv ;
1847
+ const char * * argv ;
1861
1848
PyObject * arg , * v ;
1862
1849
int i ;
1863
1850
@@ -1984,7 +1971,7 @@ PythonCmd_Error(Tcl_Interp *interp)
1984
1971
* function or method.
1985
1972
*/
1986
1973
static int
1987
- PythonCmd (ClientData clientData , Tcl_Interp * interp , int argc , char * argv [])
1974
+ PythonCmd (ClientData clientData , Tcl_Interp * interp , int argc , const char * argv [])
1988
1975
{
1989
1976
PythonCmd_ClientData * data = (PythonCmd_ClientData * )clientData ;
1990
1977
PyObject * func , * arg , * res ;
0 commit comments