Browse Source

Removed the manual padding of fields with type array.

This used to work around a bug in Mono which has now been fixed.
pull/1133/head
Dimitar Dobrev 9 years ago
parent
commit
18cc5ed24a
  1. 20
      src/Generator/Generators/CSharp/CSharpSources.cs

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

@ -802,26 +802,6 @@ namespace CppSharp.Generators.CSharp @@ -802,26 +802,6 @@ namespace CppSharp.Generators.CSharp
}
PopBlock(NewLineKind.BeforeNextBlock);
// Workaround a bug in Mono when handling fixed arrays in P/Invoke declarations.
// https://bugzilla.xamarin.com/show_bug.cgi?id=33571
if (arrayType != null && arrayType.SizeType == ArrayType.ArraySize.Constant &&
arrayType.Size > 0)
{
for (var i = 1; i < arrayType.Size; ++i)
{
var dummy = new LayoutField
{
Offset = (uint) (field.Offset + i * arrayType.ElementSize / 8),
QualifiedType = new QualifiedType(arrayType.Type),
Name = string.Format("{0}_{1}_{2}", Helpers.DummyIdentifier,
safeIdentifier, i),
FieldPtr = field.FieldPtr
};
GenerateClassInternalsField(dummy);
}
}
}
private void GenerateClassField(Field field, bool @public = false)

Loading…
Cancel
Save