Browse Source

Added a new option GenerateInternalImports that outputs "__Internal" as the library name for DllImports. Fixes #54.

For more details about what it does:  http://www.mono-project.com/Embedding_Mono#Exposing_C_code_to_the_CIL_universe).
pull/53/merge
triton 12 years ago
parent
commit
c93e77166c
  1. 1
      src/Generator/Driver.cs
  2. 3
      src/Generator/Generators/CSharp/CSharpTextTemplate.cs

1
src/Generator/Driver.cs

@ -261,6 +261,7 @@ namespace CppSharp @@ -261,6 +261,7 @@ namespace CppSharp
public bool GenerateFunctionTemplates;
public bool GeneratePartialClasses;
public bool GenerateVirtualTables;
public bool GenerateInternalImports;
public string IncludePrefix;
public bool WriteOnlyWhenChanged;
public Func<TranslationUnit, string> GenerateName;

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

@ -1998,6 +1998,9 @@ namespace CppSharp.Generators.CSharp @@ -1998,6 +1998,9 @@ namespace CppSharp.Generators.CSharp
libName = libName.Substring(3);
}
if (Options.GenerateInternalImports)
libName = "__Internal";
Write("[DllImport(\"{0}\", ", libName);
var callConv = Helpers.ToCSharpCallConv(function.CallingConvention);

Loading…
Cancel
Save