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. 7
      src/Generator/Generators/CSharp/CSharpSources.cs

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

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

Loading…
Cancel
Save