summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorWill Estes <wlestes@users.sourceforge.net>2006-10-22 22:17:38 +0000
committerWill Estes <wlestes@users.sourceforge.net>2006-10-22 22:17:38 +0000
commita4fa510851cb409efe296caf2abf17c613baaff9 (patch)
tree8f3c972101b6853965a9b76c5be02a27453d04f3 /main.c
parent6ca8e33dbcb2960da332f6d1af0728d0a3e9b1be (diff)
make yywrap work with c++ scanners as per sf bug report
Diffstat (limited to 'main.c')
-rw-r--r--main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/main.c b/main.c
index 5d8a818..c4e7923 100644
--- a/main.c
+++ b/main.c
@@ -1571,7 +1571,9 @@ void readin ()
}
if (!do_yywrap) {
- outn ("\n#define yywrap(n) 1");
+ if (!C_plus_plus) {
+ outn ("\n#define yywrap(n) 1");
+ }
outn ("#define YY_SKIP_YYWRAP");
}
@@ -1644,6 +1646,10 @@ void readin ()
if (C_plus_plus) {
outn ("\n#include <FlexLexer.h>");
+ if (!do_yywrap) {
+ outn("\nint yyFlexLexer::yywrap() { return 1; }");
+ }
+
if (yyclass) {
outn ("int yyFlexLexer::yylex()");
outn ("\t{");