Mercurial > octave
diff libinterp/corefcn/oct-tex-lexer.in.ll @ 17634:bdbf91c0a1a4
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.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 11 Oct 2013 13:58:23 -0400 |
parents | fe6518a1d87c |
children | 4197fc428c7d |
line wrap: on
line diff
--- 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 <config.h> #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 <sys/types.h> +#include <unistd.h> + +#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}+))