diff --git a/src/Generator/Generators/CLI/CLIMarshal.cs b/src/Generator/Generators/CLI/CLIMarshal.cs index cc68092e..9d8f88b2 100644 --- a/src/Generator/Generators/CLI/CLIMarshal.cs +++ b/src/Generator/Generators/CLI/CLIMarshal.cs @@ -380,7 +380,7 @@ namespace Cxxi.Generators.CLI if (pointee.IsPrimitiveType(PrimitiveType.Char)) { - Context.SupportBefore.Write( + Context.SupportBefore.WriteLine( "auto _{0} = clix::marshalString({1});", Context.ArgName, Context.Parameter.Name); @@ -592,7 +592,7 @@ namespace Cxxi.Generators.CLI Context.ParameterIndex = marshalCtx.ParameterIndex; if (!string.IsNullOrWhiteSpace(marshal.Context.SupportBefore)) - Context.SupportBefore.WriteLine(marshal.Context.SupportBefore); + Context.SupportBefore.Write(marshal.Context.SupportBefore); if(field.Type.IsPointer()) { diff --git a/src/Generator/Generators/CLI/CLISourcesTemplate.cs b/src/Generator/Generators/CLI/CLISourcesTemplate.cs index f4778af6..da889b06 100644 --- a/src/Generator/Generators/CLI/CLISourcesTemplate.cs +++ b/src/Generator/Generators/CLI/CLISourcesTemplate.cs @@ -193,12 +193,12 @@ namespace Cxxi.Generators.CLI @class.QualifiedOriginalName, field.OriginalName); if (!string.IsNullOrWhiteSpace(marshal.Context.SupportBefore)) - WriteLine(marshal.Context.SupportBefore); + Write(marshal.Context.SupportBefore); WriteLine("{0} = {1};", variable, marshal.Context.Return); if (!string.IsNullOrWhiteSpace(marshal.Context.SupportAfter)) - WriteLine(marshal.Context.SupportAfter); + Write(marshal.Context.SupportAfter); WriteCloseBraceIndent(); NewLine(); @@ -414,12 +414,12 @@ namespace Cxxi.Generators.CLI field.Visit(marshal); if (!string.IsNullOrWhiteSpace(marshal.Context.SupportBefore)) - WriteLine(marshal.Context.SupportBefore); + Write(marshal.Context.SupportBefore); WriteLine("{0} = {1};", field.Name, marshal.Context.Return); if (!string.IsNullOrWhiteSpace(marshal.Context.SupportAfter)) - WriteLine(marshal.Context.SupportAfter); + Write(marshal.Context.SupportAfter); } } @@ -507,7 +507,7 @@ namespace Cxxi.Generators.CLI param.Visit(marshal); if (!string.IsNullOrWhiteSpace(marshal.Context.SupportBefore)) - WriteLine(marshal.Context.SupportBefore); + Write(marshal.Context.SupportBefore); names.Add(marshal.Context.Return); } @@ -689,12 +689,12 @@ namespace Cxxi.Generators.CLI throw new Exception("Cannot marshal argument of function"); if (!string.IsNullOrWhiteSpace(marshal.Context.SupportBefore)) - WriteLine(marshal.Context.SupportBefore); + Write(marshal.Context.SupportBefore); WriteLine("auto {0}{1} = {2};", marshal.VarPrefix, argName, marshal.Context.Return); if (!string.IsNullOrWhiteSpace(marshal.Context.SupportAfter)) - WriteLine(marshal.Context.SupportAfter); + Write(marshal.Context.SupportAfter); var argText = marshal.ArgumentPrefix + argName; return new ParamMarshal {Name = argText, Param = param};