preprocessor: Fixed hanging in Preprocessor::expandMacros when trying to replace all '__VA_ARGS__' with '__VA_ARGS__'

This commit is contained in:
Daniel Marjamäki 2009-07-20 15:42:40 +02:00
parent 74699cab66
commit f0afdf3582
1 changed files with 3 additions and 1 deletions

View File

@ -1077,10 +1077,12 @@ public:
if ((pos = macrocode.find_first_of("\r\n")) != std::string::npos)
macrocode.erase(pos);
// Replace "__VA_ARGS__" with parameters
while ((pos = macrocode.find("__VA_ARGS__")) != std::string::npos)
pos = 0;
while ((pos = macrocode.find("__VA_ARGS__", pos)) != std::string::npos)
{
macrocode.erase(pos, 11);
macrocode.insert(pos, s);
pos += s.length();
}
}