Browse Source

Fixed processing of forward declarations in CheckMacrosPass.

pull/169/head
triton 12 years ago
parent
commit
1d0bfbcf70
  1. 12
      src/Generator/Passes/CheckMacrosPass.cs

12
src/Generator/Passes/CheckMacrosPass.cs

@ -1,4 +1,5 @@
using System.Linq; using System.Collections.Generic;
using System.Linq;
using CppSharp.AST; using CppSharp.AST;
namespace CppSharp.Passes namespace CppSharp.Passes
@ -66,6 +67,15 @@ namespace CppSharp.Passes
if (expansions.Any(e => e.Text == Prefix + "_VALUE_TYPE")) if (expansions.Any(e => e.Text == Prefix + "_VALUE_TYPE"))
@class.Type = ClassType.ValueType; @class.Type = ClassType.ValueType;
// If the class is a forward declaration, then we process the macro expansions
// of the complete class as if they were specified on the forward declaration.
if (@class.CompleteDeclaration != null)
{
var completeExpansions = @class.CompleteDeclaration.PreprocessedEntities
.OfType<MacroExpansion>();
CheckIgnoreMacros(@class, completeExpansions);
}
return base.VisitClassDecl(@class); return base.VisitClassDecl(@class);
} }

Loading…
Cancel
Save