1
#From: Tobias Frost <tobi@coldtobi.de>
2
#Subject: With newer bison (>2.7) yyscan_t is no longer defined and leads to FTBFS.
3
#Description: The below patch add the missing snippet to the bison input file,
4
# as it would has been defined with the older bison.
5
--- a/drizzled/execute/parser.yy
6
+++ b/drizzled/execute/parser.yy
16
+#include "drizzled/execute/common.h"
17
+#include <drizzled/execute/scanner.h>
20
+#ifndef __INTEL_COMPILER
21
+# pragma GCC diagnostic ignored "-Wold-style-cast"
30
%output "drizzled/execute/parser.cc"
31
%defines "drizzled/execute/parser.h"
32
-%lex-param { yyscan_t *scanner }
33
+%lex-param { void *scanner }
34
%name-prefix="execute_"
35
-%parse-param { ::drizzled::execute::Context *context }
36
-%parse-param { yyscan_t *scanner }
37
+%parse-param { class drizzled::execute::Context *context }
38
+%parse-param { void *scanner }
49
-#include <drizzled/execute/symbol.h>
50
-#include <drizzled/execute/scanner.h>
51
-#include <drizzled/execute/context.h>
54
-#ifndef __INTEL_COMPILER
55
-#pragma GCC diagnostic ignored "-Wold-style-cast"
58
#define YYENABLE_NLS 0
59
#define YYLTYPE_IS_TRIVIAL 0
61
-int execute_lex(YYSTYPE* lvalp, void* scanner);
63
#define parser_abort(A, B) do { parser::abort_func((A), (B)); YYABORT; } while (0)
65
-inline void execute_error(::drizzled::execute::Context *context, yyscan_t *scanner, const char *error)
66
+namespace drizzled { namespace execute { class Context; }}
68
+inline void execute_error(class drizzled::execute::Context *context, void *scanner, const char *error)
70
if (not context->end())
72
--- a/drizzled/execute/scanner.l
73
+++ b/drizzled/execute/scanner.l
78
-#include <drizzled/execute/parser.h>
79
-#include <drizzled/execute/context.h>
80
-#include <drizzled/execute/symbol.h>
81
-#include <drizzled/lex_string.h>
83
+#ifndef execute_HEADER_H
84
+# define execute_HEADER_H 1
87
+#include "drizzled/execute/common.h"
88
+#include "drizzled/lex_string.h"
90
using namespace drizzled;
93
#pragma GCC diagnostic ignored "-Wmissing-declarations"
96
-#define YY_EXTRA_TYPE ::drizzled::execute::Context*
97
+#ifndef YY_EXTRA_TYPE
98
+# define YY_EXTRA_TYPE drizzled::execute::Context*
104
+++ b/drizzled/execute/common.h
106
+/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
108
+ * Drizzle Execute Parser
110
+ * Copyright (C) 2013 Data Differential, http://datadifferential.com/
112
+ * All rights reserved.
114
+ * Redistribution and use in source and binary forms, with or without
115
+ * modification, are permitted provided that the following conditions are
118
+ * * Redistributions of source code must retain the above copyright
119
+ * notice, this list of conditions and the following disclaimer.
121
+ * * Redistributions in binary form must reproduce the above
122
+ * copyright notice, this list of conditions and the following disclaimer
123
+ * in the documentation and/or other materials provided with the
126
+ * * The names of its contributors may not be used to endorse or
127
+ * promote products derived from this software without specific prior
128
+ * written permission.
130
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
131
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
132
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
133
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
134
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
135
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
136
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
137
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
138
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
139
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
140
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
146
+#ifndef YY_TYPEDEF_YY_SCANNER_T
147
+# define YY_TYPEDEF_YY_SCANNER_T
148
+typedef void* yyscan_t;
151
+#include "drizzled/execute/symbol.h"
152
+#include "drizzled/execute/context.h"
153
+#include "drizzled/execute/parser.h"
154
+#include "drizzled/execute/scanner.h"