Browse Source

Global qualify ConcurrentDictionary references in generated code.

Fixes issue #747.
pull/756/head
Joao Matos 9 years ago
parent
commit
e11314143a
  1. 4
      src/Generator/Generators/CSharp/CSharpSources.cs

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

@ -501,9 +501,9 @@ namespace CppSharp.Generators.CSharp
// use interfaces if any - derived types with a secondary base this class must be compatible with the map // use interfaces if any - derived types with a secondary base this class must be compatible with the map
var @interface = @class.Namespace.Classes.Find(c => c.OriginalClass == @class); var @interface = @class.Namespace.Classes.Find(c => c.OriginalClass == @class);
WriteLine( var dict = string.Format("global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, {0}>",
"internal static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, {0}> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, {0}>();",
@interface != null ? @interface.Name : @class.Name); @interface != null ? @interface.Name : @class.Name);
WriteLine("internal static readonly {0} NativeToManagedMap = new {0}();", dict);
WriteLine("protected void*[] __OriginalVTables;"); WriteLine("protected void*[] __OriginalVTables;");
} }
PopBlock(NewLineKind.BeforeNextBlock); PopBlock(NewLineKind.BeforeNextBlock);

Loading…
Cancel
Save