diff --git a/src/Generator/Types/CppTypePrinter.cs b/src/Generator/Types/CppTypePrinter.cs index 5ed368b2..f378617e 100644 --- a/src/Generator/Types/CppTypePrinter.cs +++ b/src/Generator/Types/CppTypePrinter.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using CppSharp.AST; +using CppSharp.AST.Extensions; using Type = CppSharp.AST.Type; namespace CppSharp.Types @@ -25,6 +26,8 @@ namespace CppSharp.Types PrintTypeQualifiers = printTypeQualifiers; } + public bool ResolveTypedefs { get; set; } + public string VisitTagType(TagType tag, TypeQualifiers quals) { return tag.Declaration.Visit(this); @@ -126,6 +129,12 @@ namespace CppSharp.Types public string VisitTypedefType(TypedefType typedef, TypeQualifiers quals) { + if (ResolveTypedefs) + { + var decl = typedef.Declaration; + FunctionType func; + return decl.Type.IsPointerTo(out func) ? VisitDeclaration(decl) : decl.Type.Visit(this); + } return GetDeclName(typedef.Declaration); }