Browse Source

Fixed the generated C# code when wrapping fixed arrays of enums.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/696/head
Dimitar Dobrev 9 years ago
parent
commit
979057d263
  1. 10
      src/Generator/Generators/CSharp/CSharpTypePrinter.cs
  2. 1
      tests/Common/Common.h

10
src/Generator/Generators/CSharp/CSharpTypePrinter.cs

@ -152,6 +152,16 @@ namespace CppSharp.Generators.CSharp @@ -152,6 +152,16 @@ namespace CppSharp.Generators.CSharp
if (TypePrinterContext.Parameter != null)
return string.Format("global::System.IntPtr");
Enumeration @enum;
if (arrayType.TryGetEnum(out @enum))
{
return new CSharpTypePrinterResult
{
Type = string.Format("fixed {0}", @enum.BuiltinType),
NameSuffix = string.Format("[{0}]", array.Size)
};
}
Class @class;
if (arrayType.TryGetClass(out @class))
{

1
tests/Common/Common.h

@ -84,6 +84,7 @@ struct DLL_API Bar @@ -84,6 +84,7 @@ struct DLL_API Bar
Item RetItem1() const;
int A;
float B;
Item fixedEnumArray[3];
Bar* returnPointerToValueType();

Loading…
Cancel
Save