From 0d2f4076e002e7c51d07fe39373d2fc658426604 Mon Sep 17 00:00:00 2001 From: Francesco Montorsi Date: Sun, 21 Sep 2008 21:11:31 +0000 Subject: [PATCH] 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 --- utils/ifacecheck/src/ifacecheck.cpp | 40 ++++++++++++++++++----------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/utils/ifacecheck/src/ifacecheck.cpp b/utils/ifacecheck/src/ifacecheck.cpp index 72ecc5226a..48d5690b6e 100644 --- a/utils/ifacecheck/src/ifacecheck.cpp +++ b/utils/ifacecheck/src/ifacecheck.cpp @@ -537,24 +537,34 @@ bool IfaceCheckApp::ParsePreprocessorOutput(const wxString& filename) // the format of this line should be: // #define DEFNAME DEFVALUE - if (!line.StartsWith("#define ") || !defnameval.Contains(" ")) { - LogError("unexpected content in '%s' at line %d.", filename, i); + if (!line.StartsWith("#define ")) { + LogError("unexpected content in '%s' at line %d.", filename, i+1); return false; } - // get DEFNAME - wxString defname = defnameval.BeforeFirst(' '); - if (defname.Contains("(")) - continue; // this is a macro, skip it! - - // get DEFVAL - wxString defval = defnameval.AfterFirst(' ').Strip(wxString::both); - if (defval.StartsWith("(") && defval.EndsWith(")")) - defval = defval.Mid(1, defval.Len()-2); - - // store this pair in the doxygen interface, where it can be useful - m_doxyInterface.AddPreprocessorValue(defname, defval); - useful++; + if (defnameval.Contains(" ")) + { + // get DEFNAME + wxString defname = defnameval.BeforeFirst(' '); + if (defname.Contains("(")) + continue; // this is a macro, skip it! + + // get DEFVAL + wxString defval = defnameval.AfterFirst(' ').Strip(wxString::both); + if (defval.StartsWith("(") && defval.EndsWith(")")) + defval = defval.Mid(1, defval.Len()-2); + + // store this pair in the doxygen interface, where it can be useful + m_doxyInterface.AddPreprocessorValue(defname, defval); + 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...", -- 2.45.2