Browse Source

Enabling empty arrays of non-primitives only when not using MSVC.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/934/head
Dimitar Dobrev 8 years ago
parent
commit
358650a155
  1. 6
      src/Generator/Passes/CheckIgnoredDecls.cs
  2. 2
      tests/Common/Common.h

6
src/Generator/Passes/CheckIgnoredDecls.cs

@ -302,7 +302,7 @@ namespace CppSharp.Passes @@ -302,7 +302,7 @@ namespace CppSharp.Passes
return false;
}
if (HasInvalidType(variable.Type, variable.TranslationUnit.Module, out msg))
if (HasInvalidType(variable.Type, variable, out msg))
if (HasInvalidType(variable, out msg))
{
@ -339,7 +339,7 @@ namespace CppSharp.Passes @@ -339,7 +339,7 @@ namespace CppSharp.Passes
return false;
}
if (HasInvalidType(param.Type, @event.TranslationUnit.Module, out msg))
if (HasInvalidType(param.Type, param, out msg))
if (HasInvalidType(param, out msg))
{
@ -372,7 +372,7 @@ namespace CppSharp.Passes @@ -372,7 +372,7 @@ namespace CppSharp.Passes
/// </summary>
private bool HasInvalidType(ITypedDecl decl, out string msg)
{
return HasInvalidType(decl.Type, (Declaration)decl, out msg);
return HasInvalidType(decl.Type, (Declaration) decl, out msg);
}
private bool HasInvalidType(Type type, Declaration decl, out string msg)

2
tests/Common/Common.h

@ -711,8 +711,10 @@ class DLL_API TestFixedArrays @@ -711,8 +711,10 @@ class DLL_API TestFixedArrays
public:
TestFixedArrays();
VoidPtrRetFunctionTypedef Array[10];
#ifndef _MSC_VER
TestWideStrings ZeroSizedClassArray[0];
MyEnum ZeroSizedEnumArray[0];
#endif
int ZeroSizedArray[0];
};

Loading…
Cancel
Save