File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -135,6 +135,23 @@ if test "${LEX}" = "flex"; then
135
135
AC_DEFINE(HAVE_FLEX,1,[using flex, rather than lex])
136
136
fi
137
137
138
+ # flex >= 2.5.36 uses a nonstandard type for yyleng
139
+ AC_MSG_CHECKING([whether yyleng is yy_size_t])
140
+ cat > conftest.l <<EOF
141
+ %%
142
+ %%
143
+ yy_size_t yyleng;
144
+ EOF
145
+ $LEX conftest.l
146
+ AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED [`cat $LEX_OUTPUT_ROOT.c`]], [
147
+ AC_MSG_RESULT(yes)
148
+ AC_DEFINE(YYLENG_IS_YY_SIZE_T,1,
149
+ [Define to 1 if lex declares yyleng to be yy_size_t.])
150
+ ], [
151
+ AC_MSG_RESULT(no)
152
+ ])
153
+ rm -f conftest.l $LEX_OUTPUT_ROOT.c
154
+
138
155
# get packages we need
139
156
# gtk before 2.4.9 crashes with the way we use combobox :-(
140
157
PKG_CHECK_MODULES(REQUIRED_PACKAGES,
Original file line number Diff line number Diff line change @@ -55,7 +55,13 @@ extern InputState input_state;
55
55
void nip2yyerror ( const char * sub , ... )
56
56
__attribute__((format (printf , 1 , 2 )));
57
57
void yyerror ( const char * msg );
58
+ #ifdef YYLENG_IS_YY_SIZE_T
59
+ /* Assume yy_size_t is size_t.
60
+ */
61
+ extern size_t yyleng ;
62
+ #else
58
63
extern int yyleng ; /* lex stuff */
64
+ #endif
59
65
60
66
/* Lex gathers tokens here for workspace.c
61
67
*/
You can’t perform that action at this time.
0 commit comments