From 01d3779e2b88f6b646658724fc1bbb742158d873 Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Tue, 20 Aug 2013 00:29:13 +0300 Subject: [PATCH] Corrected the generation of the native constructor when in a structure. Signed-off-by: Dimitar Dobrev --- src/Generator/Generators/CSharp/CSharpTextTemplate.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs index d1a8309a..25a04d1b 100644 --- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs +++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs @@ -1362,7 +1362,8 @@ namespace CppSharp.Generators.CSharp PopBlock(NewLineKind.BeforeNextBlock); PushBlock(CSharpBlockKind.Method); - WriteLine("internal {0}(global::System.IntPtr native)", SafeIdentifier(@class.Name)); + WriteLine("internal {0}(global::System.IntPtr native){1}", SafeIdentifier(@class.Name), + @class.IsValueType ? " : this()" : string.Empty); var hasBaseClass = @class.HasBaseClass && @class.BaseClass.IsRefType; if (hasBaseClass)