# HG changeset patch # User John W. Eaton # Date 1269097264 14400 # Node ID 4db7beace28ef5e6b5c2c0a467dd569521990aab # Parent 0677c5d80b77a554106dacf17f32f1af1ea78624 oct-parse.yy, lex.ll: use symbols via gnulib namespace diff -r 0677c5d80b77 -r 4db7beace28e src/ChangeLog --- a/src/ChangeLog Fri Mar 19 13:00:06 2010 +0100 +++ b/src/ChangeLog Sat Mar 20 11:01:04 2010 -0400 @@ -1,3 +1,9 @@ +2010-03-20 John W. Eaton + + * lex.ll: Don't undefine GNULIB_NAMESPACE. Define fprintf, + fwrite, malloc, and realloc and GNULIB_NAMESPACE::fprintf, ... + * oct-parse.yy: Likewise. Always include cstdlib. + 2010-03-16 John W. Eaton * ls-oct-ascii.cc (save_ascii_data): Insert extra newline after diff -r 0677c5d80b77 -r 4db7beace28e src/lex.ll --- a/src/lex.ll Fri Mar 19 13:00:06 2010 +0100 +++ b/src/lex.ll Sat Mar 20 11:01:04 2010 -0400 @@ -29,9 +29,6 @@ #include #endif -#if defined (GNULIB_NAMESPACE) -#undef GNULIB_NAMESPACE -#endif } %s COMMAND_START @@ -82,6 +79,16 @@ #include #include +#if defined (GNULIB_NAMESPACE) +// Calls to the following functions appear in the generated output from +// flex without the namespace tag. Redefine them so we will use them +// via the gnulib namespace. +#define fprintf GNULIB_NAMESPACE::fprintf +#define fwrite GNULIB_NAMESPACE::fwrite +#define malloc GNULIB_NAMESPACE::malloc +#define realloc GNULIB_NAMESPACE::realloc +#endif + #if ! (defined (FLEX_SCANNER) \ && defined (YY_FLEX_MAJOR_VERSION) && YY_FLEX_MAJOR_VERSION >= 2 \ && defined (YY_FLEX_MINOR_VERSION) && YY_FLEX_MINOR_VERSION >= 5) diff -r 0677c5d80b77 -r 4db7beace28e src/oct-parse.yy --- a/src/oct-parse.yy Fri Mar 19 13:00:06 2010 +0100 +++ b/src/oct-parse.yy Sat Mar 20 11:01:04 2010 -0400 @@ -33,16 +33,9 @@ #include #endif -#if defined (GNULIB_NAMESPACE) -#undef GNULIB_NAMESPACE -#endif - #include #include - -#ifdef YYBYACC #include -#endif #include #include @@ -83,6 +76,15 @@ #include "utils.h" #include "variables.h" +#if defined (GNULIB_NAMESPACE) +// Calls to the following functions appear in the generated output from +// Bison without the namespace tag. Redefine them so we will use them +// via the gnulib namespace. +#define fclose GNULIB_NAMESPACE::fclose +#define fprintf GNULIB_NAMESPACE::fprintf +#define malloc GNULIB_NAMESPACE::malloc +#endif + // The current input line number. int input_line_number = 1;