From 1165b3020eeec52041b4f566af5b47d6ad175113 Mon Sep 17 00:00:00 2001 From: Rokas Kupstys Date: Sat, 9 Dec 2017 15:47:42 +0200 Subject: [PATCH] Fix debug output breaking generated binding code. --- src/Generator/Generators/CodeGenerator.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Generator/Generators/CodeGenerator.cs b/src/Generator/Generators/CodeGenerator.cs index 29afbad6..d102055f 100644 --- a/src/Generator/Generators/CodeGenerator.cs +++ b/src/Generator/Generators/CodeGenerator.cs @@ -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