From 0f8f0a83c457bb38ad63da329a6cc28556bb7b87 Mon Sep 17 00:00:00 2001 From: triton Date: Sun, 15 Sep 2013 02:30:34 +0100 Subject: [PATCH] Fixed generation of non-primitive/reference out/ref types. --- src/Generator/Generators/CLI/CLIMarshal.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Generator/Generators/CLI/CLIMarshal.cs b/src/Generator/Generators/CLI/CLIMarshal.cs index 99d920b7..8b7145bd 100644 --- a/src/Generator/Generators/CLI/CLIMarshal.cs +++ b/src/Generator/Generators/CLI/CLIMarshal.cs @@ -45,8 +45,10 @@ namespace CppSharp.Generators.CLI { var pointee = pointer.Pointee; + PrimitiveType primitive; var param = Context.Parameter; - if (param != null && (param.IsOut || param.IsInOut)) + if (param != null && (param.IsOut || param.IsInOut) && + pointee.IsPrimitiveType(out primitive)) { Context.Return.Write(Context.ReturnVarName); return true; @@ -65,7 +67,6 @@ namespace CppSharp.Generators.CLI return true; } - PrimitiveType primitive; if (pointee.Desugar().IsPrimitiveType(out primitive)) { Context.Return.Write("IntPtr({0})", Context.ReturnVarName);