@ -148,7 +148,7 @@ namespace CppSharp.Generators.CSharp
if (CSharpTypePrinter.IsConstCharString(pointer) || marshalPointeeAsString)
{
Context.Return.Write(MarshalStringToManaged(Context.ReturnVarName,
pointer.GetFinalPointee() as BuiltinType));
pointer.GetFinalPointee().Desugar() as BuiltinType));
return true;
}
@ -94,6 +94,7 @@ public class CommonTests : GeneratorTestFixture
str = "Hello";
hello.StringInOutRef(ref str);
Assert.That(str, Is.EqualTo("StringInOutRef"));
hello.StringTypedef(str);
[Test]
@ -270,6 +270,10 @@ void Hello::StringInOutRef(CS_IN_OUT const char*& str)
str = "Failed";
void Hello::StringTypedef(const TypedefChar* str)
int unsafeFunction(const Bar& ret, char* testForString, void (*foo)(int))
return ret.A;
@ -142,6 +142,8 @@ enum Enum
F = -9
};
typedef char TypedefChar;
class DLL_API Hello
union NestedPrivate {
@ -193,6 +195,8 @@ public:
void StringOutRef(CS_OUT const char*& str);
void StringInOut(CS_IN_OUT const char** str);
void StringInOutRef(CS_IN_OUT const char*& str);
void StringTypedef(const TypedefChar* str);
class DLL_API AbstractFoo
@ -1048,3 +1052,4 @@ class DLL_API DerivedFromTemplateInstantiationWithVirtual : public TemplateWithV
public:
DerivedFromTemplateInstantiationWithVirtual();