Browse Source

Marked the __Instance property in interfaces as synthetised.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
pull/339/head
Dimitar Dobrev 11 years ago
parent
commit
319b9691d2
  1. 3
      src/AST/Function.cs
  2. 5
      src/AST/Property.cs
  3. 6
      src/Generator/Passes/MultipleInheritancePass.cs

3
src/AST/Function.cs

@ -93,7 +93,8 @@ namespace CppSharp.AST @@ -93,7 +93,8 @@ namespace CppSharp.AST
None,
ComplementOperator,
AbstractImplCall,
DefaultValueOverload
DefaultValueOverload,
InterfaceInstance
}
public class Function : Declaration, ITypedDecl, IMangledDecl

5
src/AST/Property.cs

@ -115,6 +115,11 @@ namespace CppSharp.AST @@ -115,6 +115,11 @@ namespace CppSharp.AST
}
}
public bool IsSynthetized
{
get { return GetMethod != null && GetMethod.IsSynthetized; }
}
public override T Visit<T>(IDeclVisitor<T> visitor)
{
return visitor.VisitProperty(this);

6
src/Generator/Passes/MultipleInheritancePass.cs

@ -84,7 +84,11 @@ namespace CppSharp.Passes @@ -84,7 +84,11 @@ namespace CppSharp.Passes
instance.Namespace = @interface;
instance.Name = Helpers.InstanceIdentifier;
instance.QualifiedType = new QualifiedType(new BuiltinType(PrimitiveType.IntPtr));
instance.GetMethod = new Method { Namespace = @interface };
instance.GetMethod = new Method
{
SynthKind = FunctionSynthKind.InterfaceInstance,
Namespace = @interface
};
@interface.Properties.Add(instance);
}

Loading…
Cancel
Save