Module Name:    src
Committed By:   christos
Date:           Tue Jan  3 01:56:04 UTC 2017

Modified Files:
        src/external/bsd/flex/dist/src: flex.skl main.c

Log Message:
fix the re-entrant prefixed case.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/flex/dist/src/flex.skl
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/flex/dist/src/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/flex/dist/src/flex.skl
diff -u src/external/bsd/flex/dist/src/flex.skl:1.8 src/external/bsd/flex/dist/src/flex.skl:1.9
--- src/external/bsd/flex/dist/src/flex.skl:1.8	Mon Jan  2 19:50:11 2017
+++ src/external/bsd/flex/dist/src/flex.skl	Mon Jan  2 20:56:03 2017
@@ -113,7 +113,7 @@ m4_ifdef( [[M4_YY_PREFIX]],, [[m4_define
 
 m4preproc_define(`M4_GEN_PREFIX',
     ``[[#define yy$1 ]]M4_YY_PREFIX[[$1]]
-m4_define([[yy$1]], [[M4_YY_PREFIX[[$1]]m4_ifelse($'`#,0,,[[($'`@)]])]])'')
+%# m4_define([[yy$1]], [[M4_YY_PREFIX[[$1]]m4_ifelse($'`#,0,,[[($'`@)]])]])'')
 
 %if-c++-only
     /* The c++ scanner is a mess. The FlexLexer.h header file relies on the
@@ -126,7 +126,8 @@ m4_define([[yy$1]], [[M4_YY_PREFIX[[$1]]
 %endif
 
 %if-c-only
-m4_ifelse(M4_YY_PREFIX,M4_YY_PREFIX,,
+%if-reentrant
+m4_ifelse(M4_YY_PREFIX,yy,,
     M4_GEN_PREFIX(`_create_buffer')
     M4_GEN_PREFIX(`_delete_buffer')
     M4_GEN_PREFIX(`_scan_buffer')
@@ -164,6 +165,7 @@ m4_ifelse(M4_YY_PREFIX,M4_YY_PREFIX,,
     M4_GEN_PREFIX(`wrap')
 )
 %endif
+%endif
 
 m4_ifdef( [[M4_YY_BISON_LVAL]],
 [[

Index: src/external/bsd/flex/dist/src/main.c
diff -u src/external/bsd/flex/dist/src/main.c:1.5 src/external/bsd/flex/dist/src/main.c:1.6
--- src/external/bsd/flex/dist/src/main.c:1.5	Mon Jan  2 19:22:56 2017
+++ src/external/bsd/flex/dist/src/main.c	Mon Jan  2 20:56:03 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.5 2017/01/03 00:22:56 christos Exp $	*/
+/*	$NetBSD: main.c,v 1.6 2017/01/03 01:56:03 christos Exp $	*/
 
 /* flex - tool to generate fast lexical analyzers */
 
@@ -33,7 +33,7 @@
 /*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */
 /*  PURPOSE. */
 #include "flexdef.h"
-__RCSID("$NetBSD: main.c,v 1.5 2017/01/03 00:22:56 christos Exp $");
+__RCSID("$NetBSD: main.c,v 1.6 2017/01/03 01:56:03 christos Exp $");
 
 
 #include "version.h"
@@ -1590,9 +1590,9 @@ void readin (void)
 	if (!do_yywrap) {
 		if (!C_plus_plus) {
 			 if (reentrant)
-				outn ("\n#define yywrap(yyscanner) (/*CONSTCOND*/1)");
+				out_str ("\n#define %swrap(yyscanner) (/*CONSTCOND*/1)\n", prefix);
 			 else
-				outn ("\n#define yywrap() (/*CONSTCOND*/1)");
+				out_str ("\n#define %swrap() (/*CONSTCOND*/1)\n", prefix);
 		}
 		outn ("#define YY_SKIP_YYWRAP");
 	}

Reply via email to