From: PatR Date: Sun, 6 Dec 2015 06:59:56 +0000 (-0800) Subject: util/???_comp.l X-Git-Tag: NetHack-3.6.0_RC02~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ea6c2a49fe38e6a979140ac8a08c8ecbbb74ccc0;p=nethack util/???_comp.l A couple of minor changes, perparatory to regenerating sys/share/???_lex.c with flex-latest plus new custom skeleton for same. --- diff --git a/util/dgn_comp.l b/util/dgn_comp.l index 73c7054f9..a18b5fefc 100644 --- a/util/dgn_comp.l +++ b/util/dgn_comp.l @@ -1,5 +1,5 @@ %{ -/* NetHack 3.6 dgn_comp.l $NHDT-Date: 1448710672 2015/11/28 11:37:52 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ */ +/* NetHack 3.6 dgn_comp.l $NHDT-Date: 1449385184 2015/12/06 06:59:44 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.12 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* Copyright (c) 1990 by M. Stephenson */ /* NetHack may be freely redistributed. See license for details. */ @@ -61,20 +61,20 @@ int FDECL(yyoutput, (int)); #define YY_NO_UNPUT #endif -#ifdef FLEX_SCANNER -#define YY_MALLOC_DECL \ - genericptr_t FDECL(malloc, (size_t)); \ - genericptr_t FDECL(realloc, (genericptr_t,size_t)); +#if defined(FLEX_SCANNER) || defined(FLEXHACK_SCANNER) +/* older flex wants this */ +#define YY_MALLOC_DECL genericptr_t FDECL(malloc, (size_t)); \ + genericptr_t FDECL(realloc, (genericptr_t, size_t)); +/* newer flex assumes so needs this in case it's been suppressed */ +YY_MALLOC_DECL #endif - void FDECL(init_yyin, (FILE *)); void FDECL(init_yyout, (FILE *)); /* this doesn't always get put in dgn_comp.h * (esp. when using older versions of bison) */ - extern YYSTYPE yylval; int nh_line_number = 1; @@ -131,6 +131,7 @@ FILE *input_f; #endif yyin = input_f; } + /* analogous routine (for completeness) */ void init_yyout( output_f ) diff --git a/util/lev_comp.l b/util/lev_comp.l index 44805e0ef..c70c48148 100644 --- a/util/lev_comp.l +++ b/util/lev_comp.l @@ -1,5 +1,5 @@ %{ -/* NetHack 3.6 lev_comp.l $NHDT-Date: 1448710678 2015/11/28 11:37:58 $ $NHDT-Branch: master $:$NHDT-Revision: 1.21 $ */ +/* NetHack 3.6 lev_comp.l $NHDT-Date: 1449385191 2015/12/06 06:59:51 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.22 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -59,10 +59,12 @@ int FDECL(yyoutput, (int)); #define YY_NO_UNPUT #endif -#ifdef FLEX_SCANNER -#define YY_MALLOC_DECL \ - genericptr_t FDECL(malloc, (size_t)); \ - genericptr_t FDECL(realloc, (genericptr_t,size_t)); +#if defined(FLEX_SCANNER) || defined(FLEXHACK_SCANNER) +/* older flex wants this */ +#define YY_MALLOC_DECL genericptr_t FDECL(malloc, (size_t)); \ + genericptr_t FDECL(realloc, (genericptr_t, size_t)); +/* newer flex assumes so needs this in case it's been suppressed */ +YY_MALLOC_DECL #endif void FDECL(init_yyin, (FILE *));