Browse Source

Fixed CheckMacroPass pass to work correctly for declaration contexts.

This has been broken since we started parsing preprocessed entities for all declarations. In the specific cases of declaration contexts (translation units and namespaces) we would be processing child declaration preprocessed entities and ignoring the whole contexts by mistake.
pull/155/merge
Joao Matos 12 years ago
parent
commit
db8c2cc99e
  1. 3
      src/Generator/Passes/CheckMacrosPass.cs

3
src/Generator/Passes/CheckMacrosPass.cs

@ -45,6 +45,9 @@ namespace CppSharp.Passes @@ -45,6 +45,9 @@ namespace CppSharp.Passes
if (AlreadyVisited(decl))
return false;
if (decl is DeclarationContext)
return true;
var expansions = decl.PreprocessedEntities.OfType<MacroExpansion>();
if (expansions.Any(e => e.Text == Prefix + "_IGNORE" &&

Loading…
Cancel
Save