Patch #660485: Cygwin _tkinter Tcl/Tk 8.3 patch
The attached patch enables Cygwin Python to
build cleanly against the latest Cygwin Tcl/Tk
which is based on Tcl/Tk 8.3. It also prevents
building against the real X headers, if installed.
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index 0c3d088..212bbad 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -57,9 +57,10 @@
#include <tk.h>
#endif
-/* For Tcl 8.2 and 8.3, CONST* is not defined. */
+/* For Tcl 8.2 and 8.3, CONST* is not defined (except on Cygwin). */
#ifndef CONST84_RETURN
#define CONST84_RETURN
+#undef CONST
#define CONST
#endif
@@ -752,7 +753,7 @@
0, /*tp_hash*/
0, /*tp_call*/
(reprfunc)PyTclObject_str, /*tp_str*/
- PyObject_GenericGetAttr,/*tp_getattro*/
+ 0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT, /*tp_flags*/
@@ -2838,6 +2839,7 @@
PyDict_SetItemString(d, "TkttType", (PyObject *)&Tktt_Type);
PyTclObject_Type.ob_type = &PyType_Type;
+ PyTclObject_Type.tp_getattro = &PyObject_GenericGetAttr;
PyDict_SetItemString(d, "Tcl_Obj", (PyObject *)&PyTclObject_Type);
#ifdef TK_AQUA