Browse Source

Removed type map matching from VisitDeclaration.

We should only try to find type maps for types, else we can match type maps wrongly if the declaration name happens to have the same name as the one the type map tries to match on.
pull/147/head
triton 12 years ago
parent
commit
37bccb446d
  1. 26
      src/Generator/Generators/CLI/CLIMarshal.cs

26
src/Generator/Generators/CLI/CLIMarshal.cs

@ -194,19 +194,6 @@ namespace CppSharp.Generators.CLI
throw new NotImplementedException(); throw new NotImplementedException();
} }
public override bool VisitDeclaration(Declaration decl)
{
TypeMap typeMap;
if (Context.Driver.TypeDatabase.FindTypeMap(decl, out typeMap))
{
typeMap.Declaration = decl;
typeMap.CLIMarshalToManaged(Context);
return false;
}
return true;
}
public override bool VisitClassDecl(Class @class) public override bool VisitClassDecl(Class @class)
{ {
if (@class.CompleteDeclaration != null) if (@class.CompleteDeclaration != null)
@ -536,19 +523,6 @@ namespace CppSharp.Generators.CLI
throw new NotImplementedException(); throw new NotImplementedException();
} }
public override bool VisitDeclaration(Declaration decl)
{
TypeMap typeMap;
if (Context.Driver.TypeDatabase.FindTypeMap(decl, out typeMap))
{
typeMap.Declaration = decl;
typeMap.CLIMarshalToNative(Context);
return false;
}
return true;
}
public override bool VisitClassDecl(Class @class) public override bool VisitClassDecl(Class @class)
{ {
if (@class.CompleteDeclaration != null) if (@class.CompleteDeclaration != null)

Loading…
Cancel
Save