Browse Source

[generator] Ignore zero-sized constant C array types.

pull/935/head
Joao Matos 8 years ago
parent
commit
ec66216345
  1. 8
      src/Generator/Passes/CheckIgnoredDecls.cs
  2. 3
      tests/Common/Common.h

8
src/Generator/Passes/CheckIgnoredDecls.cs

@ -403,6 +403,14 @@ namespace CppSharp.Passes @@ -403,6 +403,14 @@ namespace CppSharp.Passes
return true;
}
var arrayType = type as ArrayType;
if (arrayType != null && arrayType.SizeType == ArrayType.ArraySize.Constant &&
arrayType.Size == 0)
{
msg = "zero-sized array";
return true;
}
msg = null;
return false;
}

3
tests/Common/Common.h

@ -711,6 +711,9 @@ class DLL_API TestFixedArrays @@ -711,6 +711,9 @@ class DLL_API TestFixedArrays
public:
TestFixedArrays();
VoidPtrRetFunctionTypedef Array[10];
TestWideStrings ZeroSizedClassArray[0];
MyEnum ZeroSizedEnumArray[0];
int ZeroSizedArray[0];
};
TestFixedArrays::TestFixedArrays() {}

Loading…
Cancel
Save