Browse Source

Simplified the code for generating virtual C# calls.

Fixes https://github.com/mono/CppSharp/issues/706.

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

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

@ -2524,7 +2524,7 @@ namespace CppSharp.Generators.CSharp @@ -2524,7 +2524,7 @@ namespace CppSharp.Generators.CSharp
int vtableIndex = 0;
if (Context.ParserOptions.IsMicrosoftAbi)
vtableIndex = @class.Layout.VFTables.IndexOf(@class.Layout.VFTables.Where(
v => v.Layout.Components.Any(c => c.Method.OriginalPtr == method.OriginalPtr)).First());
v => v.Layout.Components.Any(c => c.Method == @virtual)).First());
WriteLine("var {0} = *(void**) ((IntPtr) __OriginalVTables[{1}] + {2} * {3});",
Helpers.SlotIdentifier, vtableIndex, i, Context.TargetInfo.PointerWidth / 8);
if (method.IsDestructor && @class.IsAbstract)

Loading…
Cancel
Save