diff --git a/src/Generator/Generators/CLI/CLITypeReferences.cs b/src/Generator/Generators/CLI/CLITypeReferences.cs index 40e1a596..43dc21a7 100644 --- a/src/Generator/Generators/CLI/CLITypeReferences.cs +++ b/src/Generator/Generators/CLI/CLITypeReferences.cs @@ -36,11 +36,14 @@ namespace CppSharp.Generators.CLI get { return typeReferences.Values; } } + public HashSet GeneratedDeclarations; + public CLITypeReferenceCollector(ITypeMapDatabase typeMapDatabase, DriverOptions driverOptions) { TypeMapDatabase = typeMapDatabase; DriverOptions = driverOptions; typeReferences = new Dictionary(); + GeneratedDeclarations = new HashSet(); } public CLITypeReference GetTypeReference(Declaration decl) @@ -194,6 +197,9 @@ namespace CppSharp.Generators.CLI if (@class.IsIncomplete && @class.CompleteDeclaration != null) @class = (Class) @class.CompleteDeclaration; + if (@class.TranslationUnit == TranslationUnit) + GeneratedDeclarations.Add(@class); + string keywords; if (DriverOptions.IsCLIGenerator) keywords = @class.IsValueType ? "value struct" : "ref class";