Browse Source

Removed the useless and problematic mapping of typedef-ed classes to empty ones.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/840/head
Dimitar Dobrev 9 years ago
parent
commit
f549b63711
  1. 10
      src/Generator/Generators/CSharp/CSharpSources.cs
  2. 1
      tests/Common/Common.Tests.cs
  3. 5
      tests/Common/Common.cpp
  4. 2
      tests/Common/Common.h

10
src/Generator/Generators/CSharp/CSharpSources.cs

@ -2914,16 +2914,8 @@ namespace CppSharp.Generators.CSharp @@ -2914,16 +2914,8 @@ namespace CppSharp.Generators.CSharp
GenerateDeclarationCommon(typedef);
FunctionType functionType;
TagType tag;
if (typedef.Type.IsPointerToPrimitiveType(PrimitiveType.Void)
|| typedef.Type.IsPointerTo(out tag))
{
PushBlock(BlockKind.Typedef);
WriteLine("public class " + typedef.Name + @" { }");
PopBlock(NewLineKind.BeforeNextBlock);
}
else if (typedef.Type.IsPointerTo(out functionType))
if (typedef.Type.IsPointerTo(out functionType))
{
PushBlock(BlockKind.Typedef);
var attributedType = typedef.Type.GetPointee() as AttributedType;

1
tests/Common/Common.Tests.cs

@ -29,6 +29,7 @@ public class CommonTests : GeneratorTestFixture @@ -29,6 +29,7 @@ public class CommonTests : GeneratorTestFixture
using (var foo = new Foo())
{
Assert.That(overridesNonDirectVirtual.RetInt(foo), Is.EqualTo(3));
Assert.That(foo.FooPtr, Is.EqualTo(1));
}
}
using (var derivedFromTemplateInstantiationWithVirtual = new DerivedFromTemplateInstantiationWithVirtual())

5
tests/Common/Common.cpp

@ -33,6 +33,11 @@ bool Foo::operator ==(const Foo& other) const @@ -33,6 +33,11 @@ bool Foo::operator ==(const Foo& other) const
return A == other.A && B == other.B;
}
int Foo::fooPtr()
{
return 1;
}
Foo2::Foo2() {}
Foo2 Foo2::operator<<(signed int i)

2
tests/Common/Common.h

@ -65,6 +65,8 @@ public: @@ -65,6 +65,8 @@ public:
int TakesRef(const Foo& other);
bool operator ==(const Foo& other) const;
int fooPtr();
};
// HACK: do not move these to the cpp - C++/CLI is buggy and cannot link static fields initialised in the cpp

Loading…
Cancel
Save