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