Browse Source

Fixed two bugs.

pull/408/head
Pyry Kontio 11 years ago
parent
commit
5f23220143
  1. 2
      src/Generator/Generators/CSharp/CSharpTextTemplate.cs
  2. 4
      src/Generator/Passes/RenameRootNamespaces.cs

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

@ -133,7 +133,7 @@ namespace CppSharp.Generators.CSharp
if (reference.GenerationKind == GenerationKind.Generate && Options.GenerateLibraryNamespace) if (reference.GenerationKind == GenerationKind.Generate && Options.GenerateLibraryNamespace)
refNames.Push(Options.OutputNamespace); refNames.Push(Options.OutputNamespace);
while (refNames.Count > 0 && ctxNames.Count > 0 &&refNames.Peek() == ctxNames.Peek()) while (refNames.Count > 1 && ctxNames.Count > 1 &&refNames.Peek() == ctxNames.Peek())
{ {
refNames.Pop(); refNames.Pop();
ctxNames.Pop(); ctxNames.Pop();

4
src/Generator/Passes/RenameRootNamespaces.cs

@ -20,7 +20,9 @@ namespace CppSharp.Passes
var fileName = unit.TranslationUnit.FileName; var fileName = unit.TranslationUnit.FileName;
if (Driver.RootNamespaceRenames.ContainsKey(fileName)) if (Driver.RootNamespaceRenames.ContainsKey(fileName))
{ {
unit.Name = Driver.RootNamespaceRenames[fileName].rootNamespaceName; var rootNamespace = Driver.RootNamespaceRenames[fileName].rootNamespaceName;
if (this.Driver.Options.OutputNamespace != rootNamespace)
unit.Name = rootNamespace;
} }
else if (unit.GenerationKind == GenerationKind.Generate) else if (unit.GenerationKind == GenerationKind.Generate)
{ {

Loading…
Cancel
Save