Browse Source

Cleaned up the constructor generation logic.

pull/1/head
triton 13 years ago
parent
commit
cc1eb14fcc
  1. 18
      src/Generator/Generators/CLI/CLISourcesTemplate.cs

18
src/Generator/Generators/CLI/CLISourcesTemplate.cs

@ -141,18 +141,20 @@ namespace Cxxi.Generators.CLI
WriteStartBraceIndent(); WriteStartBraceIndent();
var nativePtr = "native";
if (isIntPtr)
{
WriteLine("auto __native = (::{0}*)native.ToPointer();",
@class.QualifiedOriginalName);
nativePtr = "__native";
}
if (@class.IsRefType) if (@class.IsRefType)
{ {
if (!hasBase) if (!hasBase)
{ {
Write("NativePtr = "); WriteLine("NativePtr = {0};", nativePtr);
if (isIntPtr)
Write("({0})", nativeType);
Write("native");
if (isIntPtr)
Write(".ToPointer()");
WriteLine(";");
} }
} }
else else

Loading…
Cancel
Save