summarylogtreecommitdiffstats
path: root/mirrormagic-2.0.2-64bit.patch
blob: e9b313423699d066eab1ac7aff17c5c869f5a5da (plain)
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
42
43
From Debian:

In src/libgame/gadgets.c, check for 64bit when handling
GDI_TYPE,GDI_STATE in HandleGadgetTags() and use int instead of
unsigned long.  Should probably really be uint32_t but I'll leave
that decision to upstream. Thanks Pelle Nilsson (and son).
64bit check borrowed from bug #496863.  Closes: #498912.

--- src/libgame/gadgets.c
+++ src/libgame/gadgets.c
@@ -18,6 +18,12 @@
 #include "text.h"
 #include "misc.h"
 
+/* check for 64bit */
+#ifdef _LP64
+#ifndef L64
+#define L64 1
+#endif
+#endif
 
 /* values for DrawGadget() */
 #define DG_UNPRESSED		0
@@ -301,11 +307,19 @@
 	break;
 
       case GDI_TYPE:
+#ifdef L64
+	gi->type = va_arg(ap, int);
+#else
 	gi->type = va_arg(ap, unsigned long);
+#endif
 	break;
 
       case GDI_STATE:
+#ifdef L64
+	gi->state = va_arg(ap, int);
+#else
 	gi->state = va_arg(ap, unsigned long);
+#endif
 	break;
 
       case GDI_CHECKED: