File: Fix-FTBFS-on-x32.patch

package info (click to toggle)
gcr 3.41.2-6
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 9,924 kB
  • sloc: ansic: 73,337; sh: 239; xml: 188; python: 174; makefile: 18
file content (41 lines) | stat: -rw-r--r-- 1,561 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
From: Laurent Bigonville <bigon@debian.org>
Date: Sun, 19 Mar 2023 12:15:50 +0100
Subject: Fix FTBFS on x32

This patch is inspired from Simon proposal on the upstream bug:
https://gitlab.gnome.org/GNOME/gcr/-/issues/45
---
 egg/egg-asn1x.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/egg/egg-asn1x.c b/egg/egg-asn1x.c
index b7d9d11..63e6b16 100644
--- a/egg/egg-asn1x.c
+++ b/egg/egg-asn1x.c
@@ -2213,7 +2213,7 @@ anode_read_time (GNode *node,
 		return anode_failure (node, "invalid time content");
 
 	/* In order to work with 32 bit time_t. */
-	if (sizeof (time_t) <= 4 && when->tm_year >= 138) {
+	if ((sizeof (time_t) <= 4 || sizeof (glong) <= 4) && when->tm_year >= 138) {
 		*value = (time_t)2145914603;  /* 2037-12-31 23:23:23 */
 
 	/* Convert to seconds since epoch */
@@ -4740,7 +4740,7 @@ egg_asn1x_parse_time_general (const gchar *time, gssize n_time)
 		return -1;
 
 	/* In order to work with 32 bit time_t. */
-	if (sizeof (time_t) <= 4 && when.tm_year >= 138) {
+	if ((sizeof (time_t) <= 4 || sizeof (glong) <= 4) && when.tm_year >= 138) {
 		value = (time_t)2145914603;  /* 2037-12-31 23:23:23 */
 
 	/* Convert to seconds since epoch */
@@ -4771,7 +4771,7 @@ egg_asn1x_parse_time_utc (const gchar *time, gssize n_time)
 		return -1;
 
 	/* In order to work with 32 bit time_t. */
-	if (sizeof (time_t) <= 4 && when.tm_year >= 138) {
+	if ((sizeof (time_t) <= 4 || sizeof (glong) <= 4) && when.tm_year >= 138) {
 		value = (time_t)2145914603;  /* 2037-12-31 23:23:23 */
 
 	/* Convert to seconds since epoch */