summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <jan.nijtmans@noemail.net>2012-07-08 04:29:12 (GMT)
committerjan.nijtmans <jan.nijtmans@noemail.net>2012-07-08 04:29:12 (GMT)
commit455ec957c419a83f0b1aff974bbec145f988029b (patch)
tree0822cebe8928ffdeb5741c454c80262cf0ce1474
parent35a3a2780f5c5fac8e4d46a56c059b7bb31e8caf (diff)
downloadtk-455ec957c419a83f0b1aff974bbec145f988029b.zip
tk-455ec957c419a83f0b1aff974bbec145f988029b.tar.gz
tk-455ec957c419a83f0b1aff974bbec145f988029b.tar.bz2
[Bug 3541305]: Xfree/Xsync... should not be macros
FossilOrigin-Name: 971cdf51705fe78a2bdabe915112d82d53da9b39
-rw-r--r--ChangeLog5
-rw-r--r--generic/tkIntXlibDecls.h31
2 files changed, 35 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index c74f093..82e10b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-07-08 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tkIntXlibDecls.h: [Bug 3541305]: Xfree/Xsync...
+ should not be macros
+
2012-07-05 Donal K. Fellows <dkf@users.sf.net>
* doc/wm.n (geometry): [Bug 3538401]: Better description of the key
diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h
index f5753c5..fb2738f 100644
--- a/generic/tkIntXlibDecls.h
+++ b/generic/tkIntXlibDecls.h
@@ -2506,6 +2506,33 @@ extern TkIntXlibStubs *tkIntXlibStubsPtr;
#undef XSync
#undef XVisualIDFromVisual
+#if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS)
+/*
+ * The following stubs implement various calls that don't do anything
+ * under Windows. In win32 tclsh 8.4 and 8.5 holds:
+ * tkIntStubsPtr->tkBindDeadWindow != NULL
+ * Then the following macros don't do anything. But when running Tcl win32
+ * version 8.6 or Cygwin (8.4, 8.5 or 8.6) then the functions are available in
+ * the stub table. The real function from the stub table will be called,
+ * even though it might be doing nothing.
+ */
+
+#define XFlush(display) (tkIntStubsPtr->tkBindDeadWindow? 0: tkIntXlibStubsPtr->xFlush(display))
+#define XGrabServer(display) (tkIntStubsPtr->tkBindDeadWindow? 0: tkIntXlibStubsPtr->xGrabServer(display))
+#define XUngrabServer(display) (tkIntStubsPtr->tkBindDeadWindow? 0: tkIntXlibStubsPtr->xUngrabServer(display))
+
+/*
+ * The following functions are implemented as macros under Windows.
+ */
+
+
+#define XFree(data) (tkIntStubsPtr->tkBindDeadWindow? ((data)? (ckfree((char *) (data)), 0): 0): tkIntXlibStubsPtr->xFree(data))
+#define XNoOp(display) (tkIntStubsPtr->tkBindDeadWindow? 0: tkIntXlibStubsPtr->xNoOp(display))
+#define XSynchronize(display, bool) (tkIntStubsPtr->tkBindDeadWindow? 0: tkIntXlibStubsPtr->xSynchronize(display, bool))
+#define XSync(display, bool) (tkIntStubsPtr->tkBindDeadWindow? 0: tkIntXlibStubsPtr->xSync(display, bool))
+#define XVisualIDFromVisual(visual) (tkIntStubsPtr->tkBindDeadWindow? ((visual)->visualid): tkIntXlibStubsPtr->xVisualIDFromVisual(visual))
+
+#else /* !USE_TK_STUBS */
/*
* The following stubs implement various calls that don't do anything
* under Windows.
@@ -2525,6 +2552,8 @@ extern TkIntXlibStubs *tkIntXlibStubsPtr;
#define XSync(display, bool) {display->request++;}
#define XVisualIDFromVisual(visual) (visual->visualid)
-#endif
+#endif /* !USE_TK_STUBS */
+
+#endif /* __WIN32__ */
#endif /* _TKINTXLIBDECLS */