ignore preprocessor lines which #define a symbol to 'nothing'
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55780 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -537,24 +537,34 @@ bool IfaceCheckApp::ParsePreprocessorOutput(const wxString& filename)
|
|||||||
|
|
||||||
// the format of this line should be:
|
// the format of this line should be:
|
||||||
// #define DEFNAME DEFVALUE
|
// #define DEFNAME DEFVALUE
|
||||||
if (!line.StartsWith("#define ") || !defnameval.Contains(" ")) {
|
if (!line.StartsWith("#define ")) {
|
||||||
LogError("unexpected content in '%s' at line %d.", filename, i);
|
LogError("unexpected content in '%s' at line %d.", filename, i+1);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// get DEFNAME
|
if (defnameval.Contains(" "))
|
||||||
wxString defname = defnameval.BeforeFirst(' ');
|
{
|
||||||
if (defname.Contains("("))
|
// get DEFNAME
|
||||||
continue; // this is a macro, skip it!
|
wxString defname = defnameval.BeforeFirst(' ');
|
||||||
|
if (defname.Contains("("))
|
||||||
|
continue; // this is a macro, skip it!
|
||||||
|
|
||||||
// get DEFVAL
|
// get DEFVAL
|
||||||
wxString defval = defnameval.AfterFirst(' ').Strip(wxString::both);
|
wxString defval = defnameval.AfterFirst(' ').Strip(wxString::both);
|
||||||
if (defval.StartsWith("(") && defval.EndsWith(")"))
|
if (defval.StartsWith("(") && defval.EndsWith(")"))
|
||||||
defval = defval.Mid(1, defval.Len()-2);
|
defval = defval.Mid(1, defval.Len()-2);
|
||||||
|
|
||||||
// store this pair in the doxygen interface, where it can be useful
|
// store this pair in the doxygen interface, where it can be useful
|
||||||
m_doxyInterface.AddPreprocessorValue(defname, defval);
|
m_doxyInterface.AddPreprocessorValue(defname, defval);
|
||||||
useful++;
|
useful++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// it looks like the format of this line is:
|
||||||
|
// #define DEFNAME
|
||||||
|
// we are not interested to symbols #defined to nothing,
|
||||||
|
// so we just ignore this line.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LogMessage("Parsed %d preprocessor #defines from '%s' which will be used later...",
|
LogMessage("Parsed %d preprocessor #defines from '%s' which will be used later...",
|
||||||
|
Reference in New Issue
Block a user