# HG changeset patch # User John W. Eaton # Date 1381514303 14400 # Node ID bdbf91c0a1a4515fae67372c94c8088d76234dfb # Parent 382aaf2d533a9ea57e860109efd87f41253f46c8 avoid warnings about symbols without gnulib:: namespace tag * oct-tex-lexer.in.ll: Define getc, fprintf, fread, fwrite, isatty, malloc, and realloc with gnulib namespace prefix. * oct-tex-parser.yy: Likewise for fclose, fprintf, and malloc. diff -r 382aaf2d533a -r bdbf91c0a1a4 libinterp/corefcn/oct-tex-lexer.in.ll --- a/libinterp/corefcn/oct-tex-lexer.in.ll Fri Oct 11 09:39:04 2013 -0700 +++ b/libinterp/corefcn/oct-tex-lexer.in.ll Fri Oct 11 13:58:23 2013 -0400 @@ -30,13 +30,38 @@ #include #endif -#include "txt-eng.h" -#include "oct-tex-parser.h" } %x NUM_MODE %x MAYBE_NUM_MODE +%{ + +// The generated code may include unistd.h. We need that to happen +// before defining isatty to be prefixed with the gnulib namespace +// identifier. + +#include +#include + +#include "txt-eng.h" +#include "oct-tex-parser.h" + +#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 fread GNULIB_NAMESPACE::fread +#define fwrite GNULIB_NAMESPACE::fwrite +#define getc GNULIB_NAMESPACE::getc +#define isatty GNULIB_NAMESPACE::isatty +#define malloc GNULIB_NAMESPACE::malloc +#define realloc GNULIB_NAMESPACE::realloc +#endif + +%} + D [0-9] NUM (({D}+\.?{D}*)|(\.{D}+)) diff -r 382aaf2d533a -r bdbf91c0a1a4 libinterp/corefcn/oct-tex-parser.yy --- a/libinterp/corefcn/oct-tex-parser.yy Fri Oct 11 09:39:04 2013 -0700 +++ b/libinterp/corefcn/oct-tex-parser.yy Fri Oct 11 13:58:23 2013 -0400 @@ -33,6 +33,15 @@ extern int octave_tex_lex (YYSTYPE *, void *); static void yyerror (text_parser_tex& parser, const char *s); +#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 + #define scanner parser.get_scanner () %}