@ -901,8 +901,9 @@ namespace CppSharp.Generators.CLI
var paramType = param.Type;
if (paramType is PointerType)
{
if (!paramType.IsReference())
paramMarshal.Prefix = "&";
paramType = (paramType as PointerType).Pointee;
}
var typePrinter = new CppTypePrinter(Driver.TypeDatabase);
@ -54,6 +54,16 @@ public class BasicTests
Assert.That(f, Is.EqualTo(10.0f));
[Test]
public void TestPrimitiveOutRefParameters()
var hello = new Hello();
float f;
Assert.That(hello.TestPrimitiveOutRef(out f), Is.True);
public void TestNullRef()
@ -101,6 +101,12 @@ bool Hello::TestPrimitiveOut(CS_OUT float* f)
return true;
bool Hello::TestPrimitiveOutRef(CS_OUT float& f)
f = 10;
int unsafeFunction(const Bar& ret, char* testForString, void (*foo)(int))
return ret.A;
@ -16,6 +16,7 @@ namespace CppSharp.Tests
lib.SetClassAsValueType("Bar");
lib.SetClassAsValueType("Bar2");
lib.SetMethodParameterUsage("Hello", "TestPrimitiveOut", 1, ParameterUsage.Out);
lib.SetMethodParameterUsage("Hello", "TestPrimitiveOutRef", 1, ParameterUsage.Out);
static class Program
@ -88,7 +88,7 @@ public:
Hello* RetNull();
bool TestPrimitiveOut(CS_OUT float* f);
bool TestPrimitiveOutRef(CS_OUT float& f);
};
class DLL_API AbstractFoo