* data/glr.c (b4_shared_declarations): Put start-header first,

before any #includes that we generate, so that feature-test
macros work.  Problem reported by Michael Deutschmann in
<http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
* data/lalr1.cc: Likewise.
* doc/bison.texinfo (Prologue): Document that feature-test macros
should be defined before any Bison declarations.
* tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
that depend on location.hh after, not before, Bison decls, since
we now include location.hh after the first user prologue.
This commit is contained in:
Paul Eggert
2006-09-11 18:56:58 +00:00
parent 84567a1b1c
commit aef3da8689
5 changed files with 36 additions and 11 deletions

View File

@@ -221,6 +221,10 @@ b4_copyright([Skeleton interface for Bison GLR parsers in C++],
#ifndef PARSER_HEADER_H
# define PARSER_HEADER_H
]m4_ifdef([b4_start_header],
[[/* Copy the %start-header blocks. */
]b4_user_start_header])[
#include <string>
#include <iostream>
@@ -233,10 +237,6 @@ namespace ]b4_namespace[
class location;
}
]m4_ifdef([b4_start_header],
[[/* Copy the %start-header blocks. */
]b4_user_start_header])[
#include "location.hh"
/* Enabling traces. */