summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixXId.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2015-11-09 15:44:24 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2015-11-09 15:44:24 (GMT)
commite450bb2502ab019788b0d6a85ba30cb3f947a81b (patch)
tree0de6a8886d3712b0093d2b9ee8bd22ab9838934c /unix/tkUnixXId.c
parent7d5930a9d7546ee43e622dd476c4a167e5217ff6 (diff)
parent86d9383e5ac170ca8a034085bb778f6fd96b7755 (diff)
downloadtk-e450bb2502ab019788b0d6a85ba30cb3f947a81b.zip
tk-e450bb2502ab019788b0d6a85ba30cb3f947a81b.tar.gz
tk-e450bb2502ab019788b0d6a85ba30cb3f947a81b.tar.bz2
Fix [5ee8af61e5ef8e233158a43459624f4ecf58a6fe|5ee8af61e5] on Unix: Window embedding can not work on 64-bit Unix and Windows
Diffstat (limited to 'unix/tkUnixXId.c')
-rw-r--r--unix/tkUnixXId.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/unix/tkUnixXId.c b/unix/tkUnixXId.c
index 819b7aa..668f228 100644
--- a/unix/tkUnixXId.c
+++ b/unix/tkUnixXId.c
@@ -125,13 +125,23 @@ TkpScanWindowId(
const char *string,
Window *idPtr)
{
- int value;
+ int code;
+ Tcl_Obj obj;
- if (Tcl_GetInt(interp, string, &value) != TCL_OK) {
- return TCL_ERROR;
+ obj.refCount = 1;
+ obj.bytes = (char *) string; /* DANGER?! */
+ obj.length = strlen(string);
+ obj.typePtr = NULL;
+
+ code = Tcl_GetLongFromObj(interp, &obj, (long *)idPtr);
+
+ if (obj.refCount > 1) {
+ Tcl_Panic("invalid sharing of Tcl_Obj on C stack");
+ }
+ if (obj.typePtr && obj.typePtr->freeIntRepProc) {
+ obj.typePtr->freeIntRepProc(&obj);
}
- *idPtr = (Window) value;
- return TCL_OK;
+ return code;
}
/*