diff --git a/macro/MacroDriver.cc b/macro/MacroDriver.cc index f2f2477e..21adc04e 100644 --- a/macro/MacroDriver.cc +++ b/macro/MacroDriver.cc @@ -21,6 +21,7 @@ #include #include #include +#include #include "MacroDriver.hh" @@ -55,7 +56,15 @@ MacroDriver::parse(const string &f, ostream &out, bool debug, bool no_line_macro stringstream file_with_endl; for (map::iterator it=defines.begin(); it!=defines.end(); it++) - file_with_endl << "@#define " << it->first << " = " << it->second << endl; + try + { + boost::lexical_cast(it->second); + file_with_endl << "@#define " << it->first << " = " << it->second << endl; + } + catch(boost::bad_lexical_cast &) + { + file_with_endl << "@#define " << it->first << " = \"" << it->second << "\"" << endl; + } file_with_endl << in.rdbuf() << endl; lexer = new MacroFlex(&file_with_endl, &out, no_line_macro);