From 995791b996400b4f2d978e3cc470c76887f3fd1e Mon Sep 17 00:00:00 2001 From: triton Date: Wed, 9 Oct 2013 03:13:57 +0100 Subject: [PATCH] References to System.Runtime.InteropServices.CallingConvention attributes are now fully qualified to fix some conflicts that could happen with generated code. --- src/Generator/Generators/CSharp/CSharpTextTemplate.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs index f99c200f..7391bdf0 100644 --- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs +++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs @@ -1332,7 +1332,7 @@ namespace CppSharp.Generators.CSharp PushBlock(CSharpBlockKind.VTableDelegate); WriteLine("[SuppressUnmanagedCodeSecurity]"); - WriteLine("[UnmanagedFunctionPointerAttribute(CallingConvention.{0})]", + WriteLine("[UnmanagedFunctionPointerAttribute(System.Runtime.InteropServices.CallingConvention.{0})]", Helpers.ToCSharpCallConv(method.CallingConvention)); CSharpTypePrinterResult retType; @@ -1401,7 +1401,7 @@ namespace CppSharp.Generators.CSharp delegateName = delegateInstance + "Delegate"; delegateRaise = delegateInstance + "RaiseInstance"; - WriteLine("[UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]"); + WriteLine("[UnmanagedFunctionPointerAttribute(System.Runtime.InteropServices.CallingConvention.Cdecl)]"); WriteLine("delegate void {0}({1});", delegateName, args); WriteLine("{0} {1};", delegateName, delegateRaise); NewLine(); @@ -2168,7 +2168,7 @@ namespace CppSharp.Generators.CSharp else if (typedef.Type.IsPointerTo(out functionType)) { PushBlock(CSharpBlockKind.Typedef); - WriteLine("[UnmanagedFunctionPointerAttribute(CallingConvention.{0})]", + WriteLine("[UnmanagedFunctionPointerAttribute(System.Runtime.InteropServices.CallingConvention.{0})]", Helpers.ToCSharpCallConv(functionType.CallingConvention)); TypePrinter.PushContext(CSharpTypePrinterContextKind.Native); WriteLine("{0}unsafe {1};", @@ -2297,7 +2297,8 @@ namespace CppSharp.Generators.CSharp Write("[DllImport(\"{0}\", ", libName); var callConv = Helpers.ToCSharpCallConv(function.CallingConvention); - WriteLine("CallingConvention = CallingConvention.{0},", callConv); + WriteLine("CallingConvention = System.Runtime.InteropServices.CallingConvention.{0},", + callConv); WriteLineIndent("EntryPoint=\"{0}\")]", function.Mangled);