From 7d404d1827ffb69a2aa7b60c10b435c6f47f7bfb Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex@linutronix.de>
Date: Fri, 18 Aug 2023 12:25:11 +0200
Subject: [PATCH] generic/tcl.h: use Tcl_WideInt for seconds in Tcl_Time

This ensures the value will not overflow, particularly on 32 bit systems
in 2038, where long will.

This patch was proposed at https://core.tcl-lang.org/tcl/tktview/86dd172271
Upstream was generally supportive of the fix, but they merged a much more
elaborate version of it for tcl 9.x (released in 9.0.0), and declined
to merge it into 8.x due to ABI breakage (sadly this change is in a public header).
But we can carry the fix downstream.

Upstream-Status: Inappropriate [see above]
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 generic/tcl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/generic/tcl.h b/generic/tcl.h
index d8fd70a..ffff4b1 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -1425,7 +1425,7 @@ typedef enum {
  */
 
 typedef struct Tcl_Time {
-    long sec;			/* Seconds. */
+    Tcl_WideInt sec;			/* Seconds. */
     long usec;			/* Microseconds. */
 } Tcl_Time;
 
