@@ -9,8 +9,8 @@ Copyright (C) 1994 Steen Lumholt.
99
1010/* TCL/TK VERSION INFO:
1111
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
1414 Tcl/Tk libraries.
1515*/
1616
@@ -36,13 +36,6 @@ Copyright (C) 1994 Steen Lumholt.
3636#define CHECK_SIZE (size , elemsize ) \
3737 ((size_t)(size) <= Py_MAX((size_t)INT_MAX, UINT_MAX / (size_t)(elemsize)))
3838
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-
4639/* If Tcl is compiled for threads, we must also define TCL_THREAD. We define
4740 it always; if Tcl is not threaded, the thread functions in
4841 Tcl are empty. */
@@ -58,15 +51,8 @@ Copyright (C) 1994 Steen Lumholt.
5851
5952#include "tkinter.h"
6053
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"
7056#endif
7157
7258#if !(defined(MS_WINDOWS ) || defined(__CYGWIN__ ))
@@ -376,10 +362,10 @@ unicodeFromTclObj(Tcl_Obj *value)
376362
377363
378364static PyObject *
379- Split (char * list )
365+ Split (const char * list )
380366{
381367 int argc ;
382- char * * argv ;
368+ const char * * argv ;
383369 PyObject * v ;
384370
385371 if (list == NULL ) {
@@ -481,7 +467,7 @@ SplitObj(PyObject *arg)
481467 }
482468 else if (PyUnicode_Check (arg )) {
483469 int argc ;
484- char * * argv ;
470+ const char * * argv ;
485471 char * list = PyUnicode_AsUTF8 (arg );
486472
487473 if (list == NULL ||
@@ -496,7 +482,7 @@ SplitObj(PyObject *arg)
496482 }
497483 else if (PyBytes_Check (arg )) {
498484 int argc ;
499- char * * argv ;
485+ const char * * argv ;
500486 char * list = PyBytes_AsString (arg );
501487
502488 if (Tcl_SplitList ((Tcl_Interp * )NULL , list , & argc , & argv ) != TCL_OK ) {
@@ -563,8 +549,9 @@ static void EnableEventHook(void); /* Forward */
563549static void DisableEventHook (void ); /* Forward */
564550
565551static 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 )
568555{
569556 TkappObject * v ;
570557 char * argv0 ;
@@ -1857,7 +1844,7 @@ Tkapp_SplitList(PyObject *self, PyObject *args)
18571844{
18581845 char * list ;
18591846 int argc ;
1860- char * * argv ;
1847+ const char * * argv ;
18611848 PyObject * arg , * v ;
18621849 int i ;
18631850
@@ -1984,7 +1971,7 @@ PythonCmd_Error(Tcl_Interp *interp)
19841971 * function or method.
19851972 */
19861973static int
1987- PythonCmd (ClientData clientData , Tcl_Interp * interp , int argc , char * argv [])
1974+ PythonCmd (ClientData clientData , Tcl_Interp * interp , int argc , const char * argv [])
19881975{
19891976 PythonCmd_ClientData * data = (PythonCmd_ClientData * )clientData ;
19901977 PyObject * func , * arg , * res ;
0 commit comments