[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
header file guards conflict
From: |
Wei Song |
Subject: |
header file guards conflict |
Date: |
Wed, 16 May 2012 15:51:26 +0100 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 |
Hi,
Just have used Bison for several months.
I have two bison parsers in one project and for some reasons the header
files of both parsers are included in one cpp code.
Different namespace names are used, therefore, these two parsers do not
conflict.
However, there is an unexpected problem.
The header guard in location.hh is BISON_LOCATION_HH, the same in both
location.hh files (not only this file).
As result, I need to do something like the following in my code:
#include "parser1.hh"
// undefine all the conflicted header guards
#undef PARSER_HEADER_H
#undef BISON_LOCATION_HH
#undef BISON_POSITION_HH
#include "parser2.hh"
Is there a better way to do it?
Thanks,
Wei
--
*Dr Wei Song ( ?? )*
Advanced Processor Technologies Group
Computer Science at the University of Manchester
http://apt.cs.man.ac.uk/apt/people/wsong/