Skip to content

Commit

Permalink
tcl8: add a backport from tcl 9.x that addresses Y2038 issues
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Kanavin <[email protected]>
  • Loading branch information
Alexander Kanavin committed Nov 14, 2024
1 parent 0d3b1c1 commit e4ab84f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From ff508f2e6786df697876140f21855ecb92a3ed36 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <[email protected]>
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.

Upstream-Status: Backport [https://core.tcl-lang.org/tcl/tktview/86dd172271]
Signed-off-by: Alexander Kanavin <[email protected]>
---
generic/tcl.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/generic/tcl.h b/generic/tcl.h
index 3a4622e..6204c57 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -1418,7 +1418,7 @@ typedef enum {
*/

typedef struct Tcl_Time {
- long sec; /* Seconds. */
+ Tcl_WideInt sec; /* Seconds. */
long usec; /* Microseconds. */
} Tcl_Time;

1 change: 1 addition & 0 deletions meta/recipes-devtools/tcltk8/tcl8_8.6.15.bb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ SRC_URI = "${BASE_SRC_URI} \
file://alter-includedir.patch \
file://interp.patch \
file://run-ptest \
file://0001-generic-tcl.h-use-Tcl_WideInt-for-seconds-in-Tcl_Tim.patch \
"
SRC_URI[sha256sum] = "844775491e435e34d83d6ccfbadd1342f1855f1705253233a86152df0765e78d"

Expand Down

0 comments on commit e4ab84f

Please sign in to comment.