Browse Source

Added CheckIgnoredDeclsPass.CheckDecayedTypes option.

This is used for Embeddinator-4000 and could be removed once we improve our support for custom types.
pull/778/head
Joao Matos 9 years ago
parent
commit
3b6cfd70f5
  1. 17
      src/Generator/Passes/CheckIgnoredDecls.cs

17
src/Generator/Passes/CheckIgnoredDecls.cs

@ -7,6 +7,8 @@ namespace CppSharp.Passes @@ -7,6 +7,8 @@ namespace CppSharp.Passes
{
public class CheckIgnoredDeclsPass : TranslationUnitPass
{
public bool CheckDecayedTypes { get; set; } = true;
public bool CheckDeclarationAccess(Declaration decl)
{
var generateNonPublicDecls = Options.IsCSharpGenerator;
@ -135,13 +137,16 @@ namespace CppSharp.Passes @@ -135,13 +137,16 @@ namespace CppSharp.Passes
return false;
}
var decayedType = param.Type.Desugar() as DecayedType;
if (decayedType != null)
if (CheckDecayedTypes)
{
function.ExplicitlyIgnore();
Diagnostics.Debug("Function '{0}' was ignored due to unsupported decayed type param",
function.Name);
return false;
var decayedType = param.Type.Desugar() as DecayedType;
if (decayedType != null)
{
function.ExplicitlyIgnore();
Diagnostics.Debug("Function '{0}' was ignored due to unsupported decayed type param",
function.Name);
return false;
}
}
if (param.Kind == ParameterKind.IndirectReturnType)

Loading…
Cancel
Save