From 703190fe704d6d1a4ca1b462789e1aae28e82abb Mon Sep 17 00:00:00 2001 From: triton Date: Thu, 9 May 2013 00:38:38 +0100 Subject: [PATCH] Fixed the wrapping of function pointers in C#. --- src/Generator/Generators/CSharp/CSharpTextTemplate.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs index 2f55157c..1ddb77c0 100644 --- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs +++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs @@ -515,8 +515,12 @@ namespace CppSharp.Generators.CSharp if (CSharpTypePrinter.IsConstCharString(field.QualifiedType)) isRefClass = true; + FunctionType functionType; + if (fieldType.IsPointerTo(out functionType)) + isRefClass = true; + if (isRefClass) - type = "void**"; + type = "void*"; var location = string.Format("({0} + {1})", instance, field.OffsetInBytes);