Browse Source

Fix a regression with headers named after keywords

Fixes https://github.com/mono/CppSharp/issues/1212.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/1214/head
Dimitar Dobrev 6 years ago
parent
commit
39d5828b64
  1. 5
      src/Generator/Generators/CSharp/CSharpSources.cs
  2. 1
      tests/Common/interface.h

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

@ -244,7 +244,7 @@ namespace CppSharp.Generators.CSharp @@ -244,7 +244,7 @@ namespace CppSharp.Generators.CSharp
return;
PushBlock(BlockKind.Functions);
var parentName = context.TranslationUnit.FileNameWithoutExtension;
var parentName = SafeIdentifier(context.TranslationUnit.FileNameWithoutExtension);
var keyword = "class";
var classes = EnumerateClasses().ToList();
@ -740,9 +740,8 @@ namespace CppSharp.Generators.CSharp @@ -740,9 +740,8 @@ namespace CppSharp.Generators.CSharp
}
}
if (@class.IsGenerated && isBindingGen)
if (@class.IsGenerated && isBindingGen && @class.IsRefType && !@class.IsOpaque)
{
if (@class.IsRefType && !@class.IsOpaque)
bases.Add("IDisposable");
}

1
tests/Common/interface.h

@ -0,0 +1 @@ @@ -0,0 +1 @@
void Func();
Loading…
Cancel
Save