aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2022-03-23 23:54:45 -0700
committerDan Willemsen <dwillemsen@google.com>2022-03-24 21:14:58 -0700
commit93704e39ae5e6a23fbf0896c8f0f8b2e04e4906f (patch)
treeccc68d0f1a7a444043dff3790945bb38b366fa65
parent9631db1d2f527f0c8338c068c754400595bed5b2 (diff)
downloadhidl-93704e39ae5e6a23fbf0896c8f0f8b2e04e4906f.tar.gz
Fix newer Bison compatibility
Bison no longer defines YYSTYPE/YYLTYPE for C++ parsers, while flex's bison bridge/location support still require them. So define them ourselves if necessary. Test: treehugger with and without upgraded bison Change-Id: I55644bb6c08109b4e2fd4f76eb3bac085e64b230
-rw-r--r--hidl-gen_l.ll8
1 files changed, 8 insertions, 0 deletions
diff --git a/hidl-gen_l.ll b/hidl-gen_l.ll
index 007cd4ce..34baa283 100644
--- a/hidl-gen_l.ll
+++ b/hidl-gen_l.ll
@@ -65,6 +65,14 @@ using token = yy::parser::token;
#define YY_DECL int yylex(YYSTYPE* yylval_param, YYLTYPE* yylloc_param, \
yyscan_t yyscanner, android::AST* const ast, android::Scope** const scope)
+#ifndef YYSTYPE
+#define YYSTYPE yy::parser::semantic_type
+#endif
+
+#ifndef YYLTYPE
+#define YYLTYPE yy::parser::location_type
+#endif
+
#define YY_USER_ACTION yylloc->step(); yylloc->columns(yyleng);
%}