From 1d0bfbcf70f59517f2dd439fb7dcf08213bb580d Mon Sep 17 00:00:00 2001 From: triton Date: Tue, 18 Feb 2014 14:06:11 +0000 Subject: [PATCH] Fixed processing of forward declarations in CheckMacrosPass. --- src/Generator/Passes/CheckMacrosPass.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Generator/Passes/CheckMacrosPass.cs b/src/Generator/Passes/CheckMacrosPass.cs index d0478c8d..9e54a405 100644 --- a/src/Generator/Passes/CheckMacrosPass.cs +++ b/src/Generator/Passes/CheckMacrosPass.cs @@ -1,4 +1,5 @@ -using System.Linq; +using System.Collections.Generic; +using System.Linq; using CppSharp.AST; namespace CppSharp.Passes @@ -66,6 +67,15 @@ namespace CppSharp.Passes if (expansions.Any(e => e.Text == Prefix + "_VALUE_TYPE")) @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(); + CheckIgnoreMacros(@class, completeExpansions); + } + return base.VisitClassDecl(@class); }