From fb4c69b4b02c1b3fac28624c16e684ae77de91fc Mon Sep 17 00:00:00 2001 From: Corey Minyard Date: Fri, 18 Mar 2022 21:40:11 -0500 Subject: [PATCH] [Go] Add missing newlines for goin typemaps In some cases the \n was missing from goin directives in some places. Without this change, you will get } swig_r = (int)(C.... in the output in some cases, and that won't compile in Go, it will error with: ../gensio/gensio.go:1508:3: expected ';', found swig_r It only did this on director callbacks with godirectorin, and only if the virtual function wasn't assigned to zero. So the following will fail: class callbacks { public: virtual bool call1(int v, const char * const *strarray); virtual ~callbacks() = default; }; but the following won't: class callbacks { public: virtual bool call1(int v, const char * const *strarray) = 0; virtual ~callbacks() = default; }; Add "\n" to the proper places to fix this. --- Source/Modules/go.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Modules/go.cxx b/Source/Modules/go.cxx index 071d39ec7..d828b00aa 100644 --- a/Source/Modules/go.cxx +++ b/Source/Modules/go.cxx @@ -3518,7 +3518,7 @@ private: goin = Copy(goin); Replaceall(goin, "$input", ln); Replaceall(goin, "$result", ivar); - Printv(f_go_wrappers, goin, NULL); + Printv(f_go_wrappers, goin, "\n", NULL); Delete(goin); } @@ -3772,7 +3772,7 @@ private: goin = Copy(goin); Replaceall(goin, "$input", ln); Replaceall(goin, "$result", ivar); - Printv(f_go_wrappers, goin, NULL); + Printv(f_go_wrappers, goin, "\n", NULL); Delete(goin); }