Browse Source

Merge pull request #356 from ddobrev/master

Fixed invalid code generated for typedef pointer params by the C++/CLI back-end
pull/357/head
João Matos 11 years ago
parent
commit
ae5b3a72a2
  1. 2
      src/Generator/Generators/CLI/CLIMarshal.cs
  2. 4
      tests/Basic/Basic.cpp
  3. 4
      tests/Basic/Basic.h

2
src/Generator/Generators/CLI/CLIMarshal.cs

@ -623,7 +623,7 @@ namespace CppSharp.Generators.CLI
return; return;
} }
if (!Context.Parameter.Type.SkipPointerRefs().IsPointer()) if (!Context.Parameter.Type.Desugar().SkipPointerRefs().IsPointer())
{ {
Context.Return.Write("*"); Context.Return.Write("*");

4
tests/Basic/Basic.cpp

@ -19,6 +19,10 @@ const char* Foo::GetANSI()
return "ANSI"; return "ANSI";
} }
void Foo::TakesTypedefedPtr(FooPtr date)
{
}
Foo2::Foo2() {} Foo2::Foo2() {}
Foo2 Foo2::operator<<(signed int i) Foo2 Foo2::operator<<(signed int i)

4
tests/Basic/Basic.h

@ -39,6 +39,10 @@ public:
// Primitive pointer types // Primitive pointer types
const int* SomePointer; const int* SomePointer;
const int** SomePointerPointer; const int** SomePointerPointer;
typedef Foo* FooPtr;
void TakesTypedefedPtr(FooPtr date);
}; };
struct DLL_API Bar struct DLL_API Bar

Loading…
Cancel
Save