Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/flex/dist/src don't #define yywrap yywrap (that...



details:   https://anonhg.NetBSD.org/src/rev/802345f53827
branches:  trunk
changeset: 350057:802345f53827
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Jan 03 00:22:56 2017 +0000

description:
don't #define yywrap yywrap (that is if the prefix is yy, don't #define macros
for the same name). Breaks compatibility for things like:
#ifndef yywrap
int
yywrap(void)
{
        return 1;
}
#endif

diffstat:

 external/bsd/flex/dist/src/flex.skl |  6 ++++++
 external/bsd/flex/dist/src/main.c   |  5 ++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diffs (68 lines):

diff -r 7e48acb63e57 -r 802345f53827 external/bsd/flex/dist/src/flex.skl
--- a/external/bsd/flex/dist/src/flex.skl       Mon Jan 02 23:21:14 2017 +0000
+++ b/external/bsd/flex/dist/src/flex.skl       Tue Jan 03 00:22:56 2017 +0000
@@ -120,6 +120,7 @@
 %endif
 
 %if-c-only
+m4_ifelse(M4_YY_PREFIX,yy,,
     M4_GEN_PREFIX(`_create_buffer')
     M4_GEN_PREFIX(`_delete_buffer')
     M4_GEN_PREFIX(`_scan_buffer')
@@ -155,6 +156,7 @@
         M4_GEN_PREFIX(`set_column')
     ]])
     M4_GEN_PREFIX(`wrap')
+)
 %endif
 
 m4_ifdef( [[M4_YY_BISON_LVAL]],
@@ -170,11 +172,14 @@
 ]])
 
 
+m4_ifelse(M4_YY_PREFIX,yy,,
     M4_GEN_PREFIX(`alloc')
     M4_GEN_PREFIX(`realloc')
     M4_GEN_PREFIX(`free')
+)
 
 %if-c-only
+m4_ifelse(M4_YY_PREFIX,yy,,
 m4_ifdef( [[M4_YY_NOT_REENTRANT]],
 [[
     M4_GEN_PREFIX(`text')
@@ -184,6 +189,7 @@
     M4_GEN_PREFIX(`_flex_debug')
     M4_GEN_PREFIX(`lineno')
 ]])
+)
 %endif
 
 
diff -r 7e48acb63e57 -r 802345f53827 external/bsd/flex/dist/src/main.c
--- a/external/bsd/flex/dist/src/main.c Mon Jan 02 23:21:14 2017 +0000
+++ b/external/bsd/flex/dist/src/main.c Tue Jan 03 00:22:56 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.4 2017/01/02 19:24:39 christos Exp $        */
+/*     $NetBSD: main.c,v 1.5 2017/01/03 00:22:56 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.4 2017/01/02 19:24:39 christos Exp $");
+__RCSID("$NetBSD: main.c,v 1.5 2017/01/03 00:22:56 christos Exp $");
 
 
 #include "version.h"
@@ -1589,7 +1589,6 @@
 
        if (!do_yywrap) {
                if (!C_plus_plus) {
-                        outn ("\n#undef yywrap");
                         if (reentrant)
                                outn ("\n#define yywrap(yyscanner) (/*CONSTCOND*/1)");
                         else



Home | Main Index | Thread Index | Old Index