From 26c8f9fcd812d9bd31a290684a5b7765ca438c2a Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Sat, 17 Aug 2013 00:09:14 +0300 Subject: [PATCH] Properly fixed the generation of members using fixed arrays. Signed-off-by: Dimitar Dobrev --- src/Generator/Generators/CSharp/CSharpTypePrinter.cs | 4 ---- src/Generator/Passes/CheckIgnoredDecls.cs | 8 ++++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Generator/Generators/CSharp/CSharpTypePrinter.cs b/src/Generator/Generators/CSharp/CSharpTypePrinter.cs index efe5bc7b..cd0b3f2f 100644 --- a/src/Generator/Generators/CSharp/CSharpTypePrinter.cs +++ b/src/Generator/Generators/CSharp/CSharpTypePrinter.cs @@ -97,10 +97,6 @@ namespace CppSharp.Generators.CSharp if (ContextKind == CSharpTypePrinterContextKind.Native && array.SizeType == ArrayType.ArraySize.Constant) { - //PrimitiveType primitive; - //if (!array.Type.Desugar().IsPrimitiveType(out primitive)) - // throw new NotSupportedException(); - return new CSharpTypePrinterResult() { Type = string.Format("fixed {0}", array.Type.Visit(this, quals)), diff --git a/src/Generator/Passes/CheckIgnoredDecls.cs b/src/Generator/Passes/CheckIgnoredDecls.cs index b693fe6b..c91da133 100644 --- a/src/Generator/Passes/CheckIgnoredDecls.cs +++ b/src/Generator/Passes/CheckIgnoredDecls.cs @@ -240,6 +240,14 @@ namespace CppSharp.Passes msg = "ignored"; return true; } + ArrayType arrayType = type as ArrayType; + PrimitiveType primitive; + if (arrayType != null && arrayType.SizeType == ArrayType.ArraySize.Constant && + !arrayType.Type.Desugar().IsPrimitiveType(out primitive)) + { + msg = "unsupported"; + return true; + } msg = null; return false;