Browse Source

Fixed the ostream type map which failed with pointers.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
pull/359/head
Dimitar Dobrev 11 years ago
parent
commit
112e4d564e
  1. 3
      src/Generator/Types/Std/Stdlib.cs
  2. 5
      tests/STL/STL.h

3
src/Generator/Types/Std/Stdlib.cs

@ -315,7 +315,8 @@ namespace CppSharp.Types.Std @@ -315,7 +315,8 @@ namespace CppSharp.Types.Std
public override void CLIMarshalToNative(MarshalContext ctx)
{
var marshal = ctx.MarshalToNative as CLIMarshalManagedToNativePrinter;
var marshal = (CLIMarshalManagedToNativePrinter) ctx.MarshalToNative;
if (!ctx.Parameter.Type.Desugar().IsPointer())
marshal.ArgumentPrefix.Write("*");
var marshalCtxName = string.Format("ctx_{0}", ctx.Parameter.Name);
ctx.SupportBefore.WriteLine("msclr::interop::marshal_context {0};", marshalCtxName);

5
tests/STL/STL.h

@ -36,4 +36,9 @@ struct DLL_API OStreamTest @@ -36,4 +36,9 @@ struct DLL_API OStreamTest
{
stream << s;
};
static void WriteToOStreamPtr(std::ostream* stream, const char* s)
{
*stream << s;
};
};
Loading…
Cancel
Save