From 18cc5ed24a578f1596cf766a0653d778ceb326ae Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Wed, 11 Jan 2017 21:26:32 +0200 Subject: [PATCH] Removed the manual padding of fields with type array. This used to work around a bug in Mono which has now been fixed. --- .../Generators/CSharp/CSharpSources.cs | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/src/Generator/Generators/CSharp/CSharpSources.cs b/src/Generator/Generators/CSharp/CSharpSources.cs index 620be3de..023d681d 100644 --- a/src/Generator/Generators/CSharp/CSharpSources.cs +++ b/src/Generator/Generators/CSharp/CSharpSources.cs @@ -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)