Browse Source

Only generate `unsafe` and `IDisposable` for bindings generation.

pull/1174/head
Joao Matos 7 years ago committed by João Matos
parent
commit
405f3ba92b
  1. 5
      src/Generator/Generators/CSharp/CSharpSources.cs

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

@ -677,6 +677,9 @@ namespace CppSharp.Generators.CSharp @@ -677,6 +677,9 @@ namespace CppSharp.Generators.CSharp
var keywords = new List<string>();
keywords.Add(@class.Access == AccessSpecifier.Protected ? "protected internal" : "public");
var isBindingGen = this.GetType() == typeof(CSharpSources);
if (isBindingGen)
keywords.Add("unsafe");
if (@class.IsAbstract)
@ -712,7 +715,7 @@ namespace CppSharp.Generators.CSharp @@ -712,7 +715,7 @@ namespace CppSharp.Generators.CSharp
}
}
if (@class.IsGenerated)
if (@class.IsGenerated && isBindingGen)
{
if (@class.IsRefType && !@class.IsOpaque)
bases.Add("IDisposable");

Loading…
Cancel
Save