summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-10-12 14:18:18 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-10-12 14:18:18 (GMT)
commit473ebe84efb63f84c2db3a04cad292b6ce4d4c15 (patch)
treea2377209ec36d296143f78fd843cd2f71d148b66
parentf43dd68346925f9c2ab0b55fe60e1cec2526d9dc (diff)
downloadtcl-473ebe84efb63f84c2db3a04cad292b6ce4d4c15.zip
tcl-473ebe84efb63f84c2db3a04cad292b6ce4d4c15.tar.gz
tcl-473ebe84efb63f84c2db3a04cad292b6ce4d4c15.tar.bz2
Fix build failure with --enable-symbols build on Windows: Some code makes assumptions on Tcl_Time structure ...
-rw-r--r--generic/tcl.h3
-rw-r--r--generic/tclDecls.h14
2 files changed, 9 insertions, 8 deletions
diff --git a/generic/tcl.h b/generic/tcl.h
index 827dc0a..2dc3ae2 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -1420,9 +1420,6 @@ typedef enum {
typedef struct Tcl_Time {
long sec; /* Seconds. */
long usec; /* Microseconds. */
-#if defined(_WIN32) && defined(_WIN64)
- __int64 reserved; /* Not used, except for win64 <-> Cygwin64 interoperability. */
-#endif
} Tcl_Time;
typedef void (Tcl_SetTimerProc) (CONST86 Tcl_Time *timePtr);
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index 26d1cd6..23f0bae 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -3954,12 +3954,16 @@ extern const TclStubs *tclStubsPtr;
/* Handle Win64 tk.dll being loaded in Cygwin64. */
# define Tcl_GetTime(t) \
do { \
- Tcl_Time *_timePtr = (t); \
- _timePtr->reserved = -1; \
- tclStubsPtr->tcl_GetTime((_timePtr)); \
- if (_timePtr->reserved != -1) { \
- _timePtr->usec = _timePtr->reserved; \
+ union { \
+ Tcl_Time now; \
+ __int64 reserved; \
+ } _t; \
+ _t.reserved = -1; \
+ tclStubsPtr->tcl_GetTime((&_t.now)); \
+ if (_t.reserved != -1) { \
+ _t.now.usec = _t.reserved; \
} \
+ *t = _t.now; \
} while (0)
# endif
# if defined(__CYGWIN__) && defined(TCL_WIDE_INT_IS_LONG)