summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwlestes <wlestes>2012-02-05 23:28:54 +0000
committerwlestes <wlestes>2012-02-05 23:28:54 +0000
commit134574b9bc3365e70e4d2b08428fc5d21036d6d3 (patch)
tree7d3ecd8bf0695f9497b14626f272d1b56dff7bb0
parente65dfc5f7c5180308a90f460f8270af326d5dc80 (diff)
downloadflex-134574b9bc3365e70e4d2b08428fc5d21036d6d3.tar.gz
fix yywrap behavior for reentrant scanners
-rw-r--r--main.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/main.c b/main.c
index 493c636..fef16f4 100644
--- a/main.c
+++ b/main.c
@@ -1578,9 +1578,11 @@ void readin ()
}
if (!do_yywrap) {
- if (!C_plus_plus) {
- outn ("\n#define yywrap() 1");
- }
+ if (!C_plus_plus)
+ if (reentrant)
+ outn ("\n#define yywrap(yyscanner) 1");
+ else
+ outn ("\n#define yywrap() 1");
outn ("#define YY_SKIP_YYWRAP");
}