Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(10)

Side by Side Diff: Modules/_tkinter.c

Issue 16840: Tkinter doesn't support large integers
Patch Set: Created 4 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Modules/tkinter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /*********************************************************** 1 /***********************************************************
2 Copyright (C) 1994 Steen Lumholt. 2 Copyright (C) 1994 Steen Lumholt.
3 3
4 All Rights Reserved 4 All Rights Reserved
5 5
6 ******************************************************************/ 6 ******************************************************************/
7 7
8 /* _tkinter.c -- Interface to libtk.a and libtcl.a. */ 8 /* _tkinter.c -- Interface to libtk.a and libtcl.a. */
9 9
10 /* TCL/TK VERSION INFO: 10 /* TCL/TK VERSION INFO:
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 #include "tkinter.h" 74 #include "tkinter.h"
75 75
76 /* For Tcl 8.2 and 8.3, CONST* is not defined (except on Cygwin). */ 76 /* For Tcl 8.2 and 8.3, CONST* is not defined (except on Cygwin). */
77 #ifndef CONST84_RETURN 77 #ifndef CONST84_RETURN
78 #define CONST84_RETURN 78 #define CONST84_RETURN
79 #undef CONST 79 #undef CONST
80 #define CONST 80 #define CONST
81 #endif 81 #endif
82 82
83 #if TK_VERSION_HEX < 0x08030102 83 #if TK_HEX_VERSION < 0x08030201
84 #error "Tk older than 8.3.1 not supported" 84 #error "Tk older than 8.3.1 not supported"
85 #endif 85 #endif
86 86
87 /* Unicode conversion assumes that Tcl_UniChar is two bytes. 87 /* Unicode conversion assumes that Tcl_UniChar is two bytes.
88 We cannot test this directly, so we test UTF-8 size instead, 88 We cannot test this directly, so we test UTF-8 size instead,
89 expecting that TCL_UTF_MAX is changed if Tcl ever supports 89 expecting that TCL_UTF_MAX is changed if Tcl ever supports
90 either UTF-16 or UCS-4. 90 either UTF-16 or UCS-4.
91 Redhat 8 sets TCL_UTF_MAX to 6, and uses wchar_t for 91 Redhat 8 sets TCL_UTF_MAX to 6, and uses wchar_t for
92 Tcl_Unichar. This is also ok as long as Python uses UCS-4, 92 Tcl_Unichar. This is also ok as long as Python uses UCS-4,
93 as well. 93 as well.
94 */ 94 */
95 #if TCL_UTF_MAX != 3 && !(defined(Py_UNICODE_WIDE) && TCL_UTF_MAX==6) 95 #if TCL_UTF_MAX != 3 && !(defined(Py_UNICODE_WIDE) && TCL_UTF_MAX==6)
96 #error "unsupported Tcl configuration" 96 #error "unsupported Tcl configuration"
97 #endif 97 #endif
98 98
99 #if TK_VERSION_HEX >= 0x08050002 99 #if TK_HEX_VERSION >= 0x08050208 && TK_HEX_VERSION < 0x08060000 || \
100 TK_HEX_VERSION >= 0x08060200
100 #define HAVE_LIBTOMMAMTH 101 #define HAVE_LIBTOMMAMTH
101 #include <tclTomMath.h> 102 #include <tclTomMath.h>
102 #endif 103 #endif
103 104
104 #if !(defined(MS_WINDOWS) || defined(__CYGWIN__)) 105 #if !(defined(MS_WINDOWS) || defined(__CYGWIN__))
105 #define HAVE_CREATEFILEHANDLER 106 #define HAVE_CREATEFILEHANDLER
106 #endif 107 #endif
107 108
108 #ifdef HAVE_CREATEFILEHANDLER 109 #ifdef HAVE_CREATEFILEHANDLER
109 110
(...skipping 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after
1398 Tcl_GetCharLength(value)); 1399 Tcl_GetCharLength(value));
1399 #endif 1400 #endif
1400 #else 1401 #else
1401 int size; 1402 int size;
1402 char *c; 1403 char *c;
1403 c = Tcl_GetStringFromObj(value, &size); 1404 c = Tcl_GetStringFromObj(value, &size);
1404 return PyString_FromStringAndSize(c, size); 1405 return PyString_FromStringAndSize(c, size);
1405 #endif 1406 #endif
1406 } 1407 }
1407 1408
1408 #if TK_VERSION_HEX >= 0x08050000 1409 #if TK_HEX_VERSION >= 0x08050000
1409 if (app->BooleanType == NULL && 1410 if (app->BooleanType == NULL &&
1410 strcmp(value->typePtr->name, "booleanString") == 0) { 1411 strcmp(value->typePtr->name, "booleanString") == 0) {
1411 /* booleanString type is not registered in Tcl */ 1412 /* booleanString type is not registered in Tcl */
1412 app->BooleanType = value->typePtr; 1413 app->BooleanType = value->typePtr;
1413 return fromBoolean(tkapp, value); 1414 return fromBoolean(tkapp, value);
1414 } 1415 }
1415 #endif 1416 #endif
1416 1417
1417 #ifdef HAVE_LIBTOMMAMTH 1418 #ifdef HAVE_LIBTOMMAMTH
1418 if (app->BignumType == NULL && 1419 if (app->BignumType == NULL &&
(...skipping 2273 matching lines...) Expand 10 before | Expand all | Expand 10 after
3692 return; 3693 return;
3693 3694
3694 #if 0 3695 #if 0
3695 /* This was not a good idea; through <Destroy> bindings, 3696 /* This was not a good idea; through <Destroy> bindings,
3696 Tcl_Finalize() may invoke Python code but at that point the 3697 Tcl_Finalize() may invoke Python code but at that point the
3697 interpreter and thread state have already been destroyed! */ 3698 interpreter and thread state have already been destroyed! */
3698 Py_AtExit(Tcl_Finalize); 3699 Py_AtExit(Tcl_Finalize);
3699 #endif 3700 #endif
3700 3701
3701 } 3702 }
OLDNEW
« no previous file with comments | « no previous file | Modules/tkinter.h » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+