Browse Source

Fixed IsInOut primitives to correctly pass the input value to the native code.

pull/267/head
Tom Spilman 12 years ago
parent
commit
47e7e68c12
  1. 7
      src/Generator/Generators/CSharp/CSharpMarshal.cs

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

@ -474,9 +474,12 @@ namespace CppSharp.Generators.CSharp @@ -474,9 +474,12 @@ namespace CppSharp.Generators.CSharp
{
var typeName = Type.TypePrinterDelegate(pointee);
Context.SupportBefore.WriteLine("{0} _{1};", typeName, param.Name);
Context.Return.Write("&_{0}", param.Name);
if (param.IsInOut)
Context.SupportBefore.WriteLine("{0} _{1} = {1};", typeName, param.Name);
else
Context.SupportBefore.WriteLine("{0} _{1};", typeName, param.Name);
Context.Return.Write("&_{0}", param.Name);
}
else
Context.Return.Write(Helpers.SafeIdentifier(Context.Parameter.Name));

Loading…
Cancel
Save