Browse Source

Fixed the generation of C# internals for templates specialising nested system types.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/661/head
Dimitar Dobrev 9 years ago
parent
commit
b5b0d92059
  1. 2
      src/Generator/Generators/CSharp/CSharpTextTemplate.cs
  2. 3
      src/Generator/Generators/CSharp/CSharpTypePrinter.cs
  3. 3
      tests/Common/Common.h

2
src/Generator/Generators/CSharp/CSharpTextTemplate.cs

@ -102,6 +102,7 @@ namespace CppSharp.Generators.CSharp
{ {
suffix.Append(typePrinter.GetNestedQualifiedName(nestedSpecialization)); suffix.Append(typePrinter.GetNestedQualifiedName(nestedSpecialization));
suffix.Append(GetSuffixForInternal(nestedSpecialization, typePrinter, true)); suffix.Append(GetSuffixForInternal(nestedSpecialization, typePrinter, true));
CSharpTypePrinter.AppendGlobal = false;
continue; continue;
} }
Class @class; Class @class;
@ -112,6 +113,7 @@ namespace CppSharp.Generators.CSharp
{ {
suffix.Append(typePrinter.GetNestedQualifiedName(nestedSpecialization)); suffix.Append(typePrinter.GetNestedQualifiedName(nestedSpecialization));
suffix.Append(GetSuffixForInternal(nestedSpecialization, typePrinter, true)); suffix.Append(GetSuffixForInternal(nestedSpecialization, typePrinter, true));
CSharpTypePrinter.AppendGlobal = false;
suffix.Append('_'); suffix.Append('_');
suffix.Append(@class.Name); suffix.Append(@class.Name);
continue; continue;

3
src/Generator/Generators/CSharp/CSharpTypePrinter.cs

@ -655,7 +655,8 @@ namespace CppSharp.Generators.CSharp
ctx = ctx.Namespace; ctx = ctx.Namespace;
} }
if (!string.IsNullOrWhiteSpace(ctx.TranslationUnit.Module.OutputNamespace)) if (!ctx.TranslationUnit.IsSystemHeader &&
!string.IsNullOrWhiteSpace(ctx.TranslationUnit.Module.OutputNamespace))
names.Add(ctx.TranslationUnit.Module.OutputNamespace); names.Add(ctx.TranslationUnit.Module.OutputNamespace);
names.Reverse(); names.Reverse();

3
tests/Common/Common.h

@ -5,6 +5,7 @@
#include <vadefs.h> #include <vadefs.h>
#endif #endif
#include <string> #include <string>
#include <vector>
class DLL_API IgnoredType class DLL_API IgnoredType
{ {
@ -1164,3 +1165,5 @@ struct polygon
class HasSystemBase : public std::string class HasSystemBase : public std::string
{ {
}; };
typedef SpecialisesVoid<std::vector<std::string>> SpecialisesWithNestedSystemTypes;

Loading…
Cancel
Save