aboutsummaryrefslogtreecommitdiffstats
path: root/main/wine/msi-use-bison-directives-insetad-of-defines.patch
blob: 5df225e7c3fe8379a4f8420084ed1fbf0f310bbb (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
132
133
134
From 3f98185fb8f88c181877e909ab1b6422fb9bca1e Mon Sep 17 00:00:00 2001
From: Alexandre Julliard <julliard@winehq.org>
Date: Thu, 1 Aug 2013 12:00:04 +0200
Subject: [PATCH] msi: Use bison directives instead of defines to specify extra
 lexer parameters.

---
 dlls/msi/cond.y  | 10 ++++------
 dlls/msi/query.h | 13 +++++++++++++
 dlls/msi/sql.y   | 23 ++++-------------------
 3 files changed, 21 insertions(+), 25 deletions(-)

diff --git a/dlls/msi/cond.y b/dlls/msi/cond.y
index 97bb002..fa55825 100644
--- a/dlls/msi/cond.y
+++ b/dlls/msi/cond.y
@@ -42,11 +42,6 @@
 #include "wine/unicode.h"
 #include "wine/list.h"
 
-#define YYLEX_PARAM info
-#define YYPARSE_PARAM info
-
-static int cond_error(const char *str);
-
 WINE_DEFAULT_DEBUG_CHANNEL(msi);
 
 typedef struct tag_yyinput
@@ -66,6 +61,7 @@ struct cond_str {
 static LPWSTR COND_GetString( COND_input *info, const struct cond_str *str );
 static LPWSTR COND_GetLiteral( COND_input *info, const struct cond_str *str );
 static int cond_lex( void *COND_lval, COND_input *info);
+static int cond_error( COND_input *info, const char *str);
 
 static void *cond_alloc( COND_input *cond, unsigned int sz );
 static void *cond_track_mem( COND_input *cond, void *ptr, unsigned int sz );
@@ -110,6 +106,8 @@ static BOOL num_from_prop( LPCWSTR p, INT *val )
 
 %}
 
+%lex-param { COND_input *info }
+%parse-param { COND_input *info }
 %pure-parser
 
 %union
@@ -798,7 +796,7 @@ static void cond_free( void *ptr )
     }
 }
 
-static int cond_error(const char *str)
+static int cond_error( COND_input *info, const char *str )
 {
     TRACE("%s\n", str );
     return 0;
diff --git a/dlls/msi/query.h b/dlls/msi/query.h
index ca34b4c..063fbb9 100644
--- a/dlls/msi/query.h
+++ b/dlls/msi/query.h
@@ -96,6 +96,19 @@ struct expr
     } u;
 };
 
+typedef struct
+{
+    MSIDATABASE *db;
+    LPCWSTR command;
+    DWORD n, len;
+    UINT r;
+    MSIVIEW **view;  /* View structure for the resulting query.  This value
+                      * tracks the view currently being created so we can free
+                      * this view on syntax error.
+                      */
+    struct list *mem;
+} SQL_input;
+
 UINT MSI_ParseSQL( MSIDATABASE *db, LPCWSTR command, MSIVIEW **phview,
                    struct list *mem ) DECLSPEC_HIDDEN;
 
diff --git a/dlls/msi/sql.y b/dlls/msi/sql.y
index ead7743..fa54741 100644
--- a/dlls/msi/sql.y
+++ b/dlls/msi/sql.y
@@ -34,29 +34,12 @@
 #include "wine/debug.h"
 #include "wine/unicode.h"
 
-#define YYLEX_PARAM info
-#define YYPARSE_PARAM info
-
-static int sql_error(const char *str);
-
 WINE_DEFAULT_DEBUG_CHANNEL(msi);
 
-typedef struct tag_SQL_input
-{
-    MSIDATABASE *db;
-    LPCWSTR command;
-    DWORD n, len;
-    UINT r;
-    MSIVIEW **view;  /* View structure for the resulting query.  This value
-                      * tracks the view currently being created so we can free
-                      * this view on syntax error.
-                      */
-    struct list *mem;
-} SQL_input;
-
 static UINT SQL_getstring( void *info, const struct sql_str *strdata, LPWSTR *str );
 static INT SQL_getint( void *info );
 static int sql_lex( void *SQL_lval, SQL_input *info );
+static int sql_error( SQL_input *info, const char *str);
 
 static LPWSTR parser_add_table( void *info, LPCWSTR list, LPCWSTR table );
 static void *parser_alloc( void *info, unsigned int sz );
@@ -77,6 +60,8 @@ static struct expr * EXPR_wildcard( void *info );
 
 %}
 
+%lex-param { SQL_input *info }
+%parse-param { SQL_input *info }
 %pure-parser
 
 %union
@@ -866,7 +851,7 @@ INT SQL_getint( void *info )
     return r;
 }
 
-static int sql_error( const char *str )
+static int sql_error( SQL_input *info, const char *str )
 {
     return 0;
 }
-- 
1.8.1.6