headers: move CPP guards into YY_*_INCLUDED to avoid collisions

See <http://lists.gnu.org/archive/html/bug-bison/2012-09/msg00016.html>.

* data/c.m4 (b4_cpp_guard): Prepend YY_ and append _INCLUDED.
* tests/headers.at: Adjust.
* NEWS, doc/bison.texi: Document.
This commit is contained in:
Akim Demaille
2012-09-27 09:43:49 +02:00
parent 5a05f42ecf
commit c9d5bcc938
4 changed files with 33 additions and 4 deletions

View File

@@ -30,7 +30,7 @@ m4_define([b4_tocpp],
# ------------------
# A valid C macro name to use as a CPP header guard for FILE.
m4_define([b4_cpp_guard],
[b4_tocpp(m4_defn([b4_prefix])/[$1])])
[[YY_]b4_tocpp(m4_defn([b4_prefix])/[$1])[_INCLUDED]])
# b4_cpp_guard_open(FILE)