Browse Source

Fixed a bug by removing this weird looking code from the C# marshaller.

The test suite still passes too.
pull/222/head
triton 11 years ago
parent
commit
21efb8fc83
  1. 9
      src/Generator/Generators/CSharp/CSharpMarshal.cs

9
src/Generator/Generators/CSharp/CSharpMarshal.cs

@ -236,15 +236,6 @@ namespace CppSharp.Generators.CSharp
var ctx = Context as CSharpMarshalContext; var ctx = Context as CSharpMarshalContext;
string instance = Context.ReturnVarName; string instance = Context.ReturnVarName;
if (ctx.Kind == CSharpMarshalKind.NativeField)
{
string copy = Generator.GeneratedIdentifier("copy");
if (VarSuffix > 0)
copy += VarSuffix;
Context.SupportBefore.WriteLine(
"var {0} = new global::System.IntPtr(&{1});", copy, instance);
instance = copy;
}
if (@class.IsRefType && if (@class.IsRefType &&
(Context.ReturnType.Qualifiers.IsConst || !Context.ReturnType.Type.IsAddress()) && (Context.ReturnType.Qualifiers.IsConst || !Context.ReturnType.Type.IsAddress()) &&

Loading…
Cancel
Save