Browse Source

Avoided ambiguous local variables when marshalling arrays.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/696/head
Dimitar Dobrev 9 years ago
parent
commit
34c75d28f6
  1. 2
      src/Generator/Generators/CSharp/CSharpMarshal.cs

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

@ -418,7 +418,7 @@ namespace CppSharp.Generators.CSharp @@ -418,7 +418,7 @@ namespace CppSharp.Generators.CSharp
Context.SupportBefore.WriteLine("if ({0} == null || {0}.Length != {1})",
Context.Parameter.Name, array.Size);
ThrowArgumentOutOfRangeException();
const string ptr = "__ptr";
var ptr = "__ptr" + Context.ParameterIndex;
Context.SupportBefore.WriteLine("fixed ({0}* {1} = {2})",
array.Type, ptr, Context.Parameter.Name);
Context.SupportBefore.WriteStartBraceIndent();

Loading…
Cancel
Save