diff options
author | Guy Harris <guy@alum.mit.edu> | 2007-07-31 01:24:26 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2007-07-31 01:24:26 +0000 |
commit | cab450519ff01e1ae7ba54266b0805eae032d158 (patch) | |
tree | 830f01992ed9807b11093d44d521381eba131607 /tools | |
parent | 9865b6346f6442bc8326cde55e5f012250748131 (diff) |
If YY_SKIP_YYWRAP is defined, don't bother defining WRAP_FUNC - with
flex 2.5.31, WRAP_FUNC will end up being defined as a value that, when
used as a function-style macro, expands to 1, so the definition of
WRAP_FUNC will get a syntax error.
svn path=/trunk/; revision=22428
Diffstat (limited to 'tools')
-rw-r--r-- | tools/lemon/lemonflex-tail.inc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/lemon/lemonflex-tail.inc b/tools/lemon/lemonflex-tail.inc index 580b8cc839..54da318ffe 100644 --- a/tools/lemon/lemonflex-tail.inc +++ b/tools/lemon/lemonflex-tail.inc @@ -17,7 +17,9 @@ int MODNAME_wrap(void); #define TEXT_FUNC CONCAT(MODNAME,_scanner_text) #define FILE_FUNC CONCAT(MODNAME,_scanner_file) #define CLEANUP_FUNC CONCAT(MODNAME,_scanner_cleanup) +#ifndef YY_SKIP_YYWRAP #define WRAP_FUNC CONCAT(MODNAME,_wrap) +#endif /* flex 2.5.31 no longer #defines these as yy_* if used with -P. */ #ifndef yy_scan_string @@ -61,15 +63,14 @@ CLEANUP_FUNC (void) yy_delete_buffer(YY_CURRENT_BUFFER); } +#ifndef YY_SKIP_YYWRAP /* Flex has an option '%option noyywrap' so that I don't have to * provide this yywrap function, but in order to maintain portability, - * I'll just use this yywrap() function. + * I'll just use this yywrap() function if that option wasn't used. */ int -WRAP_FUNC () +WRAP_FUNC (void) { return 1; /* stop at EOF, instead of looking for next file */ } - - - +#endif |