summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-09-20 12:29:39 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-09-20 12:29:39 (GMT)
commitf8ca82ac5b16009ef945379f1f3ac64544c2590b (patch)
tree68be39588a2ec7ef1b54fec71d354661501240b1
parent32befc53df03408b95b8e1ace173a67f7278d259 (diff)
downloadtk-f8ca82ac5b16009ef945379f1f3ac64544c2590b.zip
tk-f8ca82ac5b16009ef945379f1f3ac64544c2590b.tar.gz
tk-f8ca82ac5b16009ef945379f1f3ac64544c2590b.tar.bz2
Fix crash, seen on Cygwin: Tcl_Time still has 32-bit fields on Windows, this leads to a crash with gcc-11+ when loading win32 Tk in Cygwin Tcl.
-rw-r--r--generic/tkBind.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/generic/tkBind.c b/generic/tkBind.c
index da52c61..ba16aa3 100644
--- a/generic/tkBind.c
+++ b/generic/tkBind.c
@@ -792,9 +792,12 @@ GetButtonNumber(
static Time
CurrentTimeInMilliSecs(void)
{
- Tcl_Time now;
- Tcl_GetTime(&now);
- return ((Time) now.sec)*1000 + ((Time) now.usec)/1000;
+ struct {
+ Tcl_Time now;
+ Tcl_Time dummy; /* Spare, in case Tcl_Time has 32-bit fields */
+ } t;
+ Tcl_GetTime(&t.now);
+ return ((Time) t.now.sec)*1000 + ((Time) t.now.usec)/1000;
}
static Info