|
|
|
@ -333,15 +333,9 @@ namespace CppSharp.Generators.Cpp |
|
|
|
|
|
|
|
|
|
|
|
public class CppMarshalManagedToNativePrinter : MarshalPrinter<MarshalContext> |
|
|
|
public class CppMarshalManagedToNativePrinter : MarshalPrinter<MarshalContext> |
|
|
|
{ |
|
|
|
{ |
|
|
|
public readonly TextGenerator VarPrefix; |
|
|
|
|
|
|
|
public readonly TextGenerator ArgumentPrefix; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public CppMarshalManagedToNativePrinter(MarshalContext ctx) |
|
|
|
public CppMarshalManagedToNativePrinter(MarshalContext ctx) |
|
|
|
: base(ctx) |
|
|
|
: base(ctx) |
|
|
|
{ |
|
|
|
{ |
|
|
|
VarPrefix = new TextGenerator(); |
|
|
|
|
|
|
|
ArgumentPrefix = new TextGenerator(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Context.MarshalToNative = this; |
|
|
|
Context.MarshalToNative = this; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -414,7 +408,7 @@ namespace CppSharp.Generators.Cpp |
|
|
|
var isRef = Context.Parameter.Usage == ParameterUsage.Out || |
|
|
|
var isRef = Context.Parameter.Usage == ParameterUsage.Out || |
|
|
|
Context.Parameter.Usage == ParameterUsage.InOut; |
|
|
|
Context.Parameter.Usage == ParameterUsage.InOut; |
|
|
|
|
|
|
|
|
|
|
|
ArgumentPrefix.Write("&"); |
|
|
|
Context.ArgumentPrefix.Write("&"); |
|
|
|
Context.Return.Write($"(::{@enum.QualifiedOriginalName}){0}{Context.Parameter.Name}", |
|
|
|
Context.Return.Write($"(::{@enum.QualifiedOriginalName}){0}{Context.Parameter.Name}", |
|
|
|
isRef ? string.Empty : "*"); |
|
|
|
isRef ? string.Empty : "*"); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
@ -586,7 +580,7 @@ namespace CppSharp.Generators.Cpp |
|
|
|
Context.Return.Write("*"); |
|
|
|
Context.Return.Write("*"); |
|
|
|
|
|
|
|
|
|
|
|
if (Context.Parameter.Type.IsReference()) |
|
|
|
if (Context.Parameter.Type.IsReference()) |
|
|
|
VarPrefix.Write("&"); |
|
|
|
Context.VarPrefix.Write("&"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var method = Context.Function as Method; |
|
|
|
var method = Context.Function as Method; |
|
|
|
|