diff --git a/src/Generator/Generators/CSharp/CSharpTypePrinter.cs b/src/Generator/Generators/CSharp/CSharpTypePrinter.cs index 3be5a3c6..94dafe32 100644 --- a/src/Generator/Generators/CSharp/CSharpTypePrinter.cs +++ b/src/Generator/Generators/CSharp/CSharpTypePrinter.cs @@ -126,6 +126,17 @@ namespace CppSharp.Generators.CSharp } return string.Format("{0}*", array.Type.Visit(this, quals)); } + + Class @class; + if (arrayType.TryGetClass(out @class)) + { + return new CSharpTypePrinterResult() + { + Type = "fixed byte", + NameSuffix = string.Format("[{0}]", array.Size * @class.Layout.Size) + }; + } + // Do not write the fixed keyword multiple times for nested array types var fixedKeyword = array.Type is ArrayType ? string.Empty : "fixed "; return new CSharpTypePrinterResult() diff --git a/tests/CSharpTemp/CSharpTemp.h b/tests/CSharpTemp/CSharpTemp.h index d5a76e39..cc5bd8b5 100644 --- a/tests/CSharpTemp/CSharpTemp.h +++ b/tests/CSharpTemp/CSharpTemp.h @@ -59,6 +59,7 @@ public: private: int index; Foo m_foo; + Foo foos[4]; }; Bar::Bar() {}