Browse Source

Fix debug output breaking generated binding code.

pull/1022/head
Rokas Kupstys 8 years ago
parent
commit
1165b3020e
  1. 9
      src/Generator/Generators/CodeGenerator.cs

9
src/Generator/Generators/CodeGenerator.cs

@ -92,7 +92,14 @@ namespace CppSharp.Generators @@ -92,7 +92,14 @@ namespace CppSharp.Generators
public virtual void GenerateDebug(Declaration decl)
{
if (Options.GenerateDebugOutput && !string.IsNullOrWhiteSpace(decl.DebugText))
WriteLine("// DEBUG: " + decl.DebugText);
{
char[] newLineChars = {'\r', '\n'};
var text = decl.DebugText;
var index = text.IndexOfAny(newLineChars);
if (index >= 0)
text = text.Substring(0, index);
WriteLine("// DEBUG: " + text);
}
}
#endregion

Loading…
Cancel
Save