Browse Source

Add an explicit cast when we have a typedef to a primitive type. This fixes some ambiguity cases when the compiler later performs overload resolution.

pull/1/head
triton 13 years ago
parent
commit
f28db2f5f1
  1. 8
      src/Generator/Generators/CLI/CLIMarshal.cs

8
src/Generator/Generators/CLI/CLIMarshal.cs

@ -353,12 +353,18 @@ namespace Cxxi.Generators.CLI
} }
FunctionType func; FunctionType func;
if (typedef.Declaration.Type.IsPointerTo<FunctionType>(out func)) if (decl.Type.IsPointerTo<FunctionType>(out func))
{ {
VisitDelegateType(func, typedef.Declaration.OriginalName); VisitDelegateType(func, typedef.Declaration.OriginalName);
return true; return true;
} }
PrimitiveType primitive;
if (decl.Type.IsPrimitiveType(out primitive, walkTypedefs: true))
{
Return += string.Format("({0})", typedef.Declaration.Name);
}
return decl.Type.Visit(this); return decl.Type.Visit(this);
} }

Loading…
Cancel
Save