diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs index fc348a46..7df4cc3f 100644 --- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs +++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs @@ -102,6 +102,7 @@ namespace CppSharp.Generators.CSharp { suffix.Append(typePrinter.GetNestedQualifiedName(nestedSpecialization)); suffix.Append(GetSuffixForInternal(nestedSpecialization, typePrinter, true)); + CSharpTypePrinter.AppendGlobal = false; continue; } Class @class; @@ -112,6 +113,7 @@ namespace CppSharp.Generators.CSharp { suffix.Append(typePrinter.GetNestedQualifiedName(nestedSpecialization)); suffix.Append(GetSuffixForInternal(nestedSpecialization, typePrinter, true)); + CSharpTypePrinter.AppendGlobal = false; suffix.Append('_'); suffix.Append(@class.Name); continue; diff --git a/src/Generator/Generators/CSharp/CSharpTypePrinter.cs b/src/Generator/Generators/CSharp/CSharpTypePrinter.cs index 122f2300..fd5b35de 100644 --- a/src/Generator/Generators/CSharp/CSharpTypePrinter.cs +++ b/src/Generator/Generators/CSharp/CSharpTypePrinter.cs @@ -655,7 +655,8 @@ namespace CppSharp.Generators.CSharp 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.Reverse(); diff --git a/tests/Common/Common.h b/tests/Common/Common.h index e0d4c35f..fa072262 100644 --- a/tests/Common/Common.h +++ b/tests/Common/Common.h @@ -5,6 +5,7 @@ #include #endif #include +#include class DLL_API IgnoredType { @@ -1164,3 +1165,5 @@ struct polygon class HasSystemBase : public std::string { }; + +typedef SpecialisesVoid> SpecialisesWithNestedSystemTypes;