From 001348d26d1627112057a2c46d3dfef133b4a240 Mon Sep 17 00:00:00 2001 From: triton Date: Sun, 26 May 2013 18:26:00 +0100 Subject: [PATCH] Remove the shared library extension when printing it in DllImport declarations. --- src/Generator/Generators/CSharp/CSharpTextTemplate.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs index 98695cd3..b3979092 100644 --- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs +++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs @@ -1724,6 +1724,11 @@ namespace CppSharp.Generators.CSharp FindMangledDeclLibrary(function, out library); var libName = (library != null) ? library.FileName : "SymbolNotFound"; + + var index = libName.LastIndexOf('.'); + if (index >= 0) + libName = libName.Slice(0, index); + Write("[DllImport(\"{0}\", ", libName); var callConv = Helpers.ToCSharpCallConv(function.CallingConvention);