aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/libgda-fix-build.patch
blob: 35f5b9694bc5f87986862da8f6fd5f4fd6cca0c3 (about) (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
Taken from upstream.

From 4c2369083c5941ffada100e4a7e4702e681585e3 Mon Sep 17 00:00:00 2001
From: taozuhong <taozuhong@gmail.com>
Date: Tue, 11 Jan 2022 15:03:28 +0800
Subject: [PATCH] fixed compile error

---
 libgda/Gda-6.0-custom.vala |  3 +++
 libgda/sql-parser/lemon.c  | 39 +++++++++++++++++++-------------------
 2 files changed, 22 insertions(+), 20 deletions(-)

diff --git a/libgda/Gda-6.0-custom.vala b/libgda/Gda-6.0-custom.vala
index d046c5c24..4d1408648 100644
--- a/libgda/Gda-6.0-custom.vala
+++ b/libgda/Gda-6.0-custom.vala
@@ -92,7 +92,10 @@ namespace Gda {
 	[CCode (cheader_filename = "libgda.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "gda_sql_statement_get_type ()")]
 	[Compact]
 	public class SqlStatement {
+		#if VALA_0_50
+		#else
 		public static Gda.SqlStatementContentsInfo get_contents_infos (Gda.SqlStatementType type);
+		#endif
 	}
 
 }
diff --git a/libgda/sql-parser/lemon.c b/libgda/sql-parser/lemon.c
index a6fe75bb9..a3c727777 100644
--- a/libgda/sql-parser/lemon.c
+++ b/libgda/sql-parser/lemon.c
@@ -11,6 +11,7 @@
 #include <string.h>
 #include <ctype.h>
 #include <stdlib.h>
+#include <stdint.h>
 #include <assert.h>
 #include <gio/gio.h>
 
@@ -40,7 +41,7 @@ static const char **made_files = NULL;
 static int made_files_count = 0;
 static int successful_exit = 0;
 
-static char *msort(char*,char**,int(*)(const char*,const char*));
+static uintptr_t msort(uintptr_t, uintptr_t*, int(*)(const uintptr_t, const uintptr_t));
 
 /*
 ** Compilers are getting increasingly pedantic about type conversions
@@ -396,8 +397,7 @@ static int actioncmp(
 static struct action *Action_sort(
   struct action *ap
 ){
-  ap = (struct action *)msort((char *)ap,(char **)&ap->next,
-                              (int(*)(const char*,const char*))actioncmp);
+  ap = (struct action *)msort(ap, &ap->next, actioncmp);
   return ap;
 }
 
@@ -1277,14 +1277,14 @@ void Configlist_closure(struct lemon *lemp)
 
 /* Sort the configuration list */
 void Configlist_sort(){
-  current = (struct config *)msort((char *)current,(char **)&(current->next),Configcmp);
+  current = (struct config *)msort(current, &(current->next), Configcmp);
   currentend = 0;
   return;
 }
 
 /* Sort the basis configuration list */
 void Configlist_sortbasis(){
-  basis = (struct config *)msort((char *)current,(char **)&(current->bp),Configcmp);
+  basis = (struct config *)msort(current, &(current->bp), Configcmp);
   basisend = 0;
   return;
 }
@@ -1577,7 +1577,7 @@ int main(G_GNUC_UNUSED int argc, char **argv)
 /*
 ** Return a pointer to the next structure in the linked list.
 */
-#define NEXT(A) (*(char**)(((unsigned long)A)+offset))
+#define NEXT(A) (*(uintptr_t *)(((uintptr_t)A)+offset))
 
 /*
 ** Inputs:
@@ -1594,13 +1594,13 @@ int main(G_GNUC_UNUSED int argc, char **argv)
 **   The "next" pointers for elements in the lists a and b are
 **   changed.
 */
-static char *merge(
-  char *a,
-  char *b,
-  int (*cmp)(const char*,const char*),
-  int offset
+static uintptr_t merge(
+  uintptr_t a,
+  uintptr_t b,
+  int (*cmp)(const uintptr_t, const uintptr_t),
+  uintptr_t offset
 ){
-  char *ptr, *head;
+  uintptr_t ptr, *head;
 
   if( a==0 ){
     head = b;
@@ -1646,16 +1646,15 @@ static char *merge(
 **   The "next" pointers for elements in list are changed.
 */
 #define LISTSIZE 30
-static char *msort(
-  char *list,
-  char **next,
-  int (*cmp)(const char*,const char*)
+static uintptr_t msort(
+  uintptr_t list,
+  uintptr_t *next,
+  int (*cmp)(const uintptr_t, const uintptr_t)
 ){
-  unsigned long offset;
-  char *ep;
-  char *set[LISTSIZE];
+  uintptr_t ep;
+  uintptr_t set[LISTSIZE];
   int i;
-  offset = (unsigned long)next - (unsigned long)list;
+  uintptr_t offset = (uintptr_t)next - (uintptr_t)list;
   for(i=0; i<LISTSIZE; i++) set[i] = 0;
   while( list ){
     ep = list;
-- 
GitLab