Browse Source

Improve CheckIgnoredDecls.IsTypeExternal to deal with declarations with no namespaces.

pull/1133/head
Joao Matos 9 years ago
parent
commit
22c80b3fe1
  1. 12
      src/Generator/Passes/CheckIgnoredDecls.cs

12
src/Generator/Passes/CheckIgnoredDecls.cs

@ -403,16 +403,22 @@ namespace CppSharp.Passes @@ -403,16 +403,22 @@ namespace CppSharp.Passes
private bool IsTypeExternal(Module module, Type type)
{
Declaration declaration;
if ((type.GetFinalPointee() ?? type).TryGetDeclaration(out declaration))
{
if (!(type.GetFinalPointee() ?? type).TryGetDeclaration(out declaration))
return false;
declaration = declaration.CompleteDeclaration ?? declaration;
if (declaration.Namespace == null || declaration.TranslationUnit.Module == null)
return false;
// Check if there’s another module which wraps libraries with dependencies on
// the ones in the current module.
if (declaration.TranslationUnit.Module.Libraries.Any(l =>
Context.Symbols.Libraries.First(
lib => lib.FileName == l).Dependencies.Any(
d => module != declaration.TranslationUnit.Module &&
module.Libraries.Contains(d))))
return true;
}
return false;
}

Loading…
Cancel
Save