Browse Source

Properly fixed the generation of members using fixed arrays.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
pull/41/head
Dimitar Dobrev 12 years ago
parent
commit
26c8f9fcd8
  1. 4
      src/Generator/Generators/CSharp/CSharpTypePrinter.cs
  2. 8
      src/Generator/Passes/CheckIgnoredDecls.cs

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

@ -97,10 +97,6 @@ namespace CppSharp.Generators.CSharp
if (ContextKind == CSharpTypePrinterContextKind.Native && if (ContextKind == CSharpTypePrinterContextKind.Native &&
array.SizeType == ArrayType.ArraySize.Constant) array.SizeType == ArrayType.ArraySize.Constant)
{ {
//PrimitiveType primitive;
//if (!array.Type.Desugar().IsPrimitiveType(out primitive))
// throw new NotSupportedException();
return new CSharpTypePrinterResult() return new CSharpTypePrinterResult()
{ {
Type = string.Format("fixed {0}", array.Type.Visit(this, quals)), Type = string.Format("fixed {0}", array.Type.Visit(this, quals)),

8
src/Generator/Passes/CheckIgnoredDecls.cs

@ -240,6 +240,14 @@ namespace CppSharp.Passes
msg = "ignored"; msg = "ignored";
return true; 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; msg = null;
return false; return false;

Loading…
Cancel
Save